Interface IJAXBVersatileReader<T>

  • Type Parameters:
    T - The type to be read
    All Known Implementing Classes:
    JAXBVersatileReader

    public interface IJAXBVersatileReader<T>
    Interface for reading XML documents from various sources.
    Author:
    Philip Helger
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default T read​(byte[] aXML)
      Read a document from the specified byte array.
      default T read​(char[] aXML)
      Read a document from the specified char array.
      default T read​(com.helger.commons.io.IHasInputStream aISP)
      Read a document from the specified input stream provider.
      default T read​(com.helger.commons.io.resource.IReadableResource aResource)
      Read a document from the specified resource.
      default T 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 T read​(File aFile)
      Read a document from the specified file.
      default T read​(InputStream aIS)
      Read a document from the specified input stream.
      default T read​(Reader aReader)
      Read a document from the specified reader.
      default T read​(String sXML)
      Read a document from the specified String.
      default T read​(ByteBuffer aXML)
      Read a document from the specified byte buffer.
      default T read​(Path aPath)
      Read a document from the specified Path.
      T read​(Source aSource)
      Read a document from the specified source.
      T read​(Node aNode)
      Read a document from the specified DOM node.
      default T read​(InputSource aInputSource)
      Read a document from the specified input source.
    • Method Detail

      • read

        @Nullable
        default T 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 T 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 T 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 T 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 T 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 T 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 T 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 T 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 T 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 T 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 T 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 T 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

        @Nullable
        T 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
        T 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.