Skip to content

Instantly share code, notes, and snippets.

@simonharrer
Created April 12, 2013 10:11
Show Gist options
  • Save simonharrer/5371022 to your computer and use it in GitHub Desktop.
Save simonharrer/5371022 to your computer and use it in GitHub Desktop.
Simple example for JAXB
import javax.xml.bind.JAXB;
import javax.xml.bind.JAXBException;
public class Person {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public static void main(String[] args) throws JAXBException {
Person person = new Person();
person.setName("Max Mustermann");
person.setAge(39);
JAXB.marshal(person, System.out);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment