Class JAXBUtils


  • public final class JAXBUtils
    extends Object
    Contains utility methods that integrate JAXB with Axiom.
    • Method Detail

      • unmarshal

        public static Object unmarshal​(OMContainer container,
                                       JAXBContext context,
                                       UnmarshallerConfigurator configurator,
                                       boolean preserve)
                                throws JAXBException
        Unmarshall the information item using JAXB.
        Parameters:
        container - the document or element to unmarshall
        context - the JAXB context
        configurator - custom unmarshaller settings to apply; may be null
        preserve - specifies whether the content of the information item should be preserved
        Returns:
        the unmarshalled object
        Throws:
        JAXBException - if an error occurred while unmarshalling
      • unmarshal

        public static <T> JAXBElement<T> unmarshal​(OMContainer container,
                                                   JAXBContext context,
                                                   UnmarshallerConfigurator configurator,
                                                   Class<T> declaredType,
                                                   boolean preserve)
                                            throws JAXBException
        Unmarshall the information item using JAXB.
        Parameters:
        container - the document or element to unmarshall
        context - the JAXB context
        configurator - custom unmarshaller settings to apply; may be null
        declaredType - a JAXB mapped class to hold the XML data.
        preserve - specifies whether the content of the information item should be preserved
        Returns:
        the unmarshalled object
        Throws:
        JAXBException - if an error occurred while unmarshalling