JAXB (Java Platform SE 8 ) (original) (raw)

public final class JAXB
extends Object
Class that defines convenience methods for common, simple use of JAXB.
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 JAXB. 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 JAXB API directly.
  2. Errors that happen during the processing is wrapped intoDataBindingException (which will have JAXBException as its cause. It is expected that people who prefer the checked exception would use the rest of the JAXB API directly.
    In addition, the unmarshal methods have the following characteristic:
  3. 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:
  4. 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:
    2.1

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.