Class AponReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class AponReader
    extends AponFormat
    implements java.io.Closeable
    Converts a string in APON format to a Parameters object.
    • Constructor Detail

      • AponReader

        public AponReader​(java.lang.String text)
        Instantiates a new AponReader.
        Parameters:
        text - the APON formatted string
      • AponReader

        public AponReader​(java.io.Reader reader)
        Instantiates a new AponReader.
        Parameters:
        reader - the character stream capable of parsing content into APON
    • Method Detail

      • read

        public Parameters read()
                        throws java.io.IOException
        Reads an APON document into a VariableParameters object.
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • read

        public <T extends Parameters> T read​(T parameters)
                                      throws java.io.IOException
        Reads an APON formatted document into the specified Parameters object.
        Type Parameters:
        T - the generic type
        Parameters:
        parameters - the Parameters object
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • parse

        public static Parameters parse​(java.lang.String text)
                                throws java.io.IOException
        Converts an APON formatted string into a Parameters object.
        Parameters:
        text - the APON formatted string
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • parse

        public static <T extends Parameters> T parse​(java.lang.String text,
                                                     java.lang.Class<T> requiredType)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • parse

        public static <T extends Parameters> T parse​(java.lang.String text,
                                                     T parameters)
                                              throws java.io.IOException
        Converts an APON formatted string into a given Parameters object.
        Type Parameters:
        T - the generic type
        Parameters:
        text - the APON formatted string
        parameters - the Parameters object
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • parse

        public static Parameters parse​(java.io.File file)
                                throws java.io.IOException
        Converts to a Parameters object from a file.
        Parameters:
        file - the file to parse
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • parse

        public static Parameters parse​(java.io.File file,
                                       java.lang.String encoding)
                                throws java.io.IOException
        Converts to a Parameters object from a file.
        Parameters:
        file - the file to parse
        encoding - the character encoding
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • parse

        public static <T extends Parameters> T parse​(java.io.File file,
                                                     T parameters)
                                              throws java.io.IOException
        Converts into a given Parameters object from a file.
        Type Parameters:
        T - the generic type
        Parameters:
        file - the file to parse
        parameters - the Parameters object
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • parse

        public static <T extends Parameters> T parse​(java.io.File file,
                                                     java.lang.String encoding,
                                                     T parameters)
                                              throws java.io.IOException
        Converts into a given Parameters object from a file.
        Type Parameters:
        T - the generic type
        Parameters:
        file - the file to parse
        encoding - the character encoding
        parameters - the Parameters object
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • parse

        public static Parameters parse​(java.io.Reader reader)
                                throws java.io.IOException
        Converts to a Parameters object from a character-input stream.
        Parameters:
        reader - the character-input stream
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails
      • parse

        public static <T extends Parameters> T parse​(java.io.Reader reader,
                                                     T parameters)
                                              throws java.io.IOException
        Converts into a given Parameters object from a character-input stream.
        Type Parameters:
        T - the generic type
        Parameters:
        reader - the character-input stream
        parameters - the Parameters object
        Returns:
        the Parameters object
        Throws:
        java.io.IOException - if reading APON format document fails