Interface XmlServiceParser

All Known Implementing Classes:
DomXmlParser, JAXBXmlParser

@Contract public interface XmlServiceParser
If an implementation of this exists it will be used to parse the XML file rather than the default implementation which uses JAXB
Author:
jwells
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The default Xml parsing service will have this name
    static final String
    A stream parsing service that does not use JAXB but an internal stream based implementation
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    <T> void
    marshal(OutputStream outputStream, XmlRootHandle<T> root, Map<String,Object> options)
    Marshalls this tree into the given stream.
    <T> T
    parseRoot(Model rootModel, InputStream input, jakarta.xml.bind.Unmarshaller.Listener listener, Map<String,Object> options)
    This method must return an instance of the given class as the root of an XML graph
    <T> T
    parseRoot(Model rootModel, URI location, jakarta.xml.bind.Unmarshaller.Listener listener, Map<String,Object> options)
    This method must return an instance of the given class as the root of an XML graph
  • Field Details

    • DEFAULT_PARSING_SERVICE

      static final String DEFAULT_PARSING_SERVICE
      The default Xml parsing service will have this name
      See Also:
    • STREAM_PARSING_SERVICE

      static final String STREAM_PARSING_SERVICE
      A stream parsing service that does not use JAXB but an internal stream based implementation
      See Also:
  • Method Details

    • parseRoot

      <T> T parseRoot(Model rootModel, URI location, jakarta.xml.bind.Unmarshaller.Listener listener, Map<String,Object> options) throws Exception
      This method must return an instance of the given class as the root of an XML graph
      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

      <T> T parseRoot(Model rootModel, InputStream input, jakarta.xml.bind.Unmarshaller.Listener listener, Map<String,Object> options) throws Exception
      This method must return an instance of the given class as the root of an XML graph
      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

      PreGenerationRequirement getPreGenerationRequirement()
      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
      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

      <T> void marshal(OutputStream outputStream, XmlRootHandle<T> root, Map<String,Object> options) throws IOException
      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
      Parameters:
      outputStream - A non-closed output stream. This method will not close the output stream
      root - The root of the tree to marshall
      options - optional (possibly null) options from the caller
      Throws:
      IOException - On any exception that might happen