Class JAXBXmlParser

java.lang.Object
org.glassfish.hk2.xml.jaxb.internal.JAXBXmlParser
All Implemented Interfaces:
XmlServiceParser

@Singleton @Named("JAXBXmlParsingService") @Visibility(LOCAL) public class JAXBXmlParser extends Object implements XmlServiceParser
This is the default implementation
Author:
jwells
  • Constructor Details

    • JAXBXmlParser

      public JAXBXmlParser()
  • Method Details

    • parseRoot

      public <T> T parseRoot(Model rootModel, URI location, jakarta.xml.bind.Unmarshaller.Listener listener, Map<String,Object> options) throws Exception
      Description copied from interface: XmlServiceParser
      This method must return an instance of the given class as the root of an XML graph
      Specified by:
      parseRoot in interface XmlServiceParser
      Parameters:
      rootModel - The Model object of the root to be parsed
      location - The location of the file to parse
      listener - A listener that must be called via the contract of Unmarshaller.Listener
      options - optional (possibly null) options from the caller
      Returns:
      The root object with all fields filled in from the given document
      Throws:
      Exception
    • parseRoot

      public <T> T parseRoot(Model rootModel, InputStream input, jakarta.xml.bind.Unmarshaller.Listener listener, Map<String,Object> options) throws Exception
      Description copied from interface: XmlServiceParser
      This method must return an instance of the given class as the root of an XML graph
      Specified by:
      parseRoot in interface XmlServiceParser
      Parameters:
      rootModel - The Model object of the root to be parsed
      input - A non-null input stream. This stream will NOT be closed by this method
      listener - A listener that must be called via the contract of Unmarshaller.Listener
      options - optional (possibly null) options from the caller
      Returns:
      The root object with all fields filled in from the given document
      Throws:
      Exception
    • getPreGenerationRequirement

      public PreGenerationRequirement getPreGenerationRequirement()
      Description copied from interface: XmlServiceParser
      This tells the system whether or not it needs to pregenerate all proxies prior to parsing a document or if the proxies can be generated lazily
      Specified by:
      getPreGenerationRequirement in interface XmlServiceParser
      Returns:
      The value that indicates whether or not the proxies can be loaded lazily or must be pre-generated prior to parsing a document
    • marshal

      public <T> void marshal(OutputStream outputStream, XmlRootHandle<T> rootHandle, Map<String,Object> options) throws IOException
      Description copied from interface: XmlServiceParser
      Marshalls this tree into the given stream. Will hold the WRITE lock of this tree while it does so that the tree cannot change underneath while it is being written out. It will use a basic indentation and new-line scheme
      Specified by:
      marshal in interface XmlServiceParser
      Parameters:
      outputStream - A non-closed output stream. This method will not close the output stream
      rootHandle - The root of the tree to marshall
      options - optional (possibly null) options from the caller
      Throws:
      IOException - On any exception that might happen