Class AponReader


  • public class AponReader
    extends AponFormat
    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 whose contents can be parsed as APON
    • Method Detail

      • read

        public <T extends Parameters> T read​(T parameters)
        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:
        AponParseException - if reading APON format document fails
      • close

        public void close()
                   throws java.io.IOException
        Closes the reader.
        Throws:
        java.io.IOException - if an I/O error occurs
      • parse

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

        public static <T extends Parameters> T parse​(java.lang.String text,
                                                     T parameters)
                                              throws AponParseException
        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:
        AponParseException - if reading APON format document fails
      • parse

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

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

        public static <T extends Parameters> T parse​(java.io.File file,
                                                     T parameters)
                                              throws AponParseException
        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:
        AponParseException - 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 AponParseException
        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:
        AponParseException - if reading APON format document fails
      • parse

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

        public static <T extends Parameters> T parse​(java.io.Reader reader,
                                                     T parameters)
                                              throws AponParseException
        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:
        AponParseException - if reading APON format document fails