Class JAXB

java.lang.Object
jakarta.xml.bind.JAXB

public final class JAXB extends Object
Class that defines convenience methods for common, simple use of Jakarta XML Binding.

Methods defined in this class are convenience methods that combine several basic operations in the JAXBContext, Unmarshaller, and Marshaller. They are designed to be the prefered methods for developers new to Jakarta XML Binding. They have the following characterstics:

  1. Generally speaking, the performance is not necessarily optimal. It is expected that people who need to write performance critical code will use the rest of the Jakarta XML Binding API directly.
  2. Errors that happen during the processing is wrapped into DataBindingException (which will have JAXBException as its cause. It is expected that people who prefer the checked exception would use the rest of the Jakarta XML Binding API directly.

In addition, the unmarshal methods have the following characteristic:

  1. Schema validation is not performed on the input XML. The processing will try to continue even if there are errors in the XML, as much as possible. Only as the last resort, this method fails with DataBindingException.

Similarly, the marshal methods have the following characteristic:

  1. The processing will try to continue even if the Java object tree does not meet the validity requirement. Only as the last resort, this method fails with DataBindingException.

All the methods on this class require non-null arguments to all parameters. The unmarshal methods either fail with an exception or return a non-null value.

Since:
1.6, JAXB 2.1