javax.xml.bind.annotation


1. Root Element Name

@XmlRootElement(name = "rootElement")
public class ExampleClass {}

2. Element Name

@XmlElement(name = "elementName")
public String elementName;

3. Attribute Name

@XmlAttribute(name = "attributeName")
public String attributeName;

4. Type Conversion

@XmlJavaTypeAdapter(MyAdapter.class)
public String date;

5. Element Wrapper

@XmlElementWrapper(name = "wrapperElement")
@XmlElement(name = "wrappedElement")
public List<String> list;

6. Ignore Element

@XmlTransient
public String ignoredField;

7. Default Value

8. Nillable Element

9. Namespace Prefix

10. Polymorphism

11. Customization

12. Transient Customization

13. Collection Element Wrapper

14. Attribute Customization

15. Map Element Wrapper

16. Discriminator

17. Enum Wrapper

18. Choice

19. Inheritance

20. Element Collection

21. Embeddable Class

22. Transient Element

23. Customization with XMLType

24. Override Default Type Adapter

25. Collection of Embeddable Classes

26. Map of Embeddable Classes

27. Override Element Name of Collection Type

28. Mixed Content

29. Ignored Embeddable Class

30. Customization with XmlAccessorOrder

31. Root Element Customization

32. Ignored Type Adapter

33. Default Polymorphism Handling