Interface IJAXBReader<JAXBTYPE>

Type Parameters:
JAXBTYPE - The JAXB type to be read
All Known Implementing Classes:
GenericJAXBMarshaller, JAXBReaderBuilder

public interface IJAXBReader<JAXBTYPE>
Interface for reading JAXB documents from various sources.
Author:
Philip Helger
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    default JAXBTYPE
    read(byte[] aXML)
    Read a document from the specified byte array.
    default JAXBTYPE
    read(byte[] aXML, int nOfs, int nLen)
    Read a document from the specified byte array.
    default JAXBTYPE
    read(char[] aXML)
    Read a document from the specified char array.
    default JAXBTYPE
    read(com.helger.commons.io.IHasInputStream aISP)
    Read a document from the specified input stream provider.
    default JAXBTYPE
    read(com.helger.commons.io.resource.IReadableResource aResource)
    Read a document from the specified resource.
    Read a document using the passed handler.
    default JAXBTYPE
    read(com.helger.xml.serialize.read.SAXReaderSettings aSettings, InputSource aInputSource)
    Read a document from the specified input source using the specified SAX reader settings.
    default JAXBTYPE
    read(File aFile)
    Read a document from the specified file.
    default JAXBTYPE
    Read a document from the specified input stream.
    default JAXBTYPE
    read(Reader aReader)
    Read a document from the specified reader.
    default JAXBTYPE
    read(String sXML)
    Read a document from the specified String.
    default JAXBTYPE
    Read a document from the specified byte buffer.
    default JAXBTYPE
    read(Path aPath)
    Read a document from the specified Path.
    default JAXBTYPE
    Unmarshal root element to JAXB and return the resulting content tree.
    default JAXBTYPE
    Unmarshal root element to JAXB and return the resulting content tree.
    default JAXBTYPE
    read(Source aSource)
    Read a document from the specified source.
    default JAXBTYPE
    read(Node aNode)
    Read a document from the specified DOM node.
    default JAXBTYPE
    read(InputSource aInputSource)
    Read a document from the specified input source.
  • Method Details

    • isUseSchema

      boolean isUseSchema()
      Returns:
      true if an eventually configured XML Schema should be used, false to explicitly disable the usage of XML Schema.
      Since:
      11.0.3
    • read

      @Nullable default JAXBTYPE read(@Nonnull InputSource aInputSource)
      Read a document from the specified input source. The secure reading feature has affect when using this method.
      Parameters:
      aInputSource - The source to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull com.helger.xml.serialize.read.SAXReaderSettings aSettings, @Nonnull InputSource aInputSource)
      Read a document from the specified input source using the specified SAX reader settings. The secure reading must be enabled in the SAX settings.
      Parameters:
      aSettings - The SAX Settings to use.
      aInputSource - The source to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull InputStream aIS)
      Read a document from the specified input stream. The secure reading feature has affect when using this method.
      Parameters:
      aIS - The input stream to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull Reader aReader)
      Read a document from the specified reader. The secure reading feature has affect when using this method.
      Parameters:
      aReader - The reader to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull File aFile)
      Read a document from the specified file. The secure reading feature has affect when using this method.
      Parameters:
      aFile - The file to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull Path aPath)
      Read a document from the specified Path. The secure reading feature has affect when using this method.
      Parameters:
      aPath - The path to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull com.helger.commons.io.resource.IReadableResource aResource)
      Read a document from the specified resource. The secure reading feature has affect when using this method.
      Parameters:
      aResource - The resource to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull com.helger.commons.io.IHasInputStream aISP)
      Read a document from the specified input stream provider. The secure reading feature has affect when using this method.
      Parameters:
      aISP - The input stream provider to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull byte[] aXML)
      Read a document from the specified byte array. The secure reading feature has affect when using this method.
      Parameters:
      aXML - The XML bytes to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull byte[] aXML, @Nonnegative int nOfs, @Nonnegative int nLen)
      Read a document from the specified byte array. The secure reading feature has affect when using this method.
      Parameters:
      aXML - The XML bytes to read. May not be null.
      nOfs - the offset in the buffer of the first byte to read.
      nLen - the maximum number of bytes to read from the buffer.
      Returns:
      null in case reading fails.
      Since:
      10.1.4
    • read

      @Nullable default JAXBTYPE read(@Nonnull ByteBuffer aXML)
      Read a document from the specified byte buffer. The secure reading feature has affect when using this method.
      Parameters:
      aXML - The XML bytes to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull String sXML)
      Read a document from the specified String. The secure reading feature has affect when using this method.
      Parameters:
      sXML - The XML string to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull char[] aXML)
      Read a document from the specified char array. The secure reading feature has affect when using this method.
      Parameters:
      aXML - The XML string to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      Read a document using the passed handler.
      Parameters:
      aHandler - The unmarshalling handler. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull Source aSource)
      Read a document from the specified source. The secure reading feature has NO affect when using this method because the parameter type is too generic.
      Parameters:
      aSource - The source to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull Node aNode)
      Read a document from the specified DOM node. The secure reading feature has NO affect when using this method because no parsing happens! To ensure secure reading the Node must first be serialized to a String and be parsed again!
      Parameters:
      aNode - The DOM node to read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull XMLStreamReader aReader)
      Unmarshal root element to JAXB and return the resulting content tree.
      Parameters:
      aReader - The parser to be read. May not be null.
      Returns:
      null in case reading fails.
    • read

      @Nullable default JAXBTYPE read(@Nonnull XMLEventReader aReader)
      Unmarshal root element to JAXB and return the resulting content tree.
      Parameters:
      aReader - The parser to be read. May not be null.
      Returns:
      null in case reading fails.