Package com.aspectran.core.util.apon
Class AponReader
- java.lang.Object
-
- com.aspectran.core.util.apon.AponFormat
-
- com.aspectran.core.util.apon.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.
-
-
Field Summary
-
Fields inherited from class com.aspectran.core.util.apon.AponFormat
COMMENT_LINE_START, CURLY_BRACKET_CLOSE, CURLY_BRACKET_OPEN, DEFAULT_INDENT_STRING, DOUBLE_QUOTE_CHAR, ESCAPE_CHAR, FALSE, NAME_VALUE_SEPARATOR, NEW_LINE, NEW_LINE_CHAR, NO_CONTROL_CHAR, NULL, ROUND_BRACKET_CLOSE, ROUND_BRACKET_OPEN, SINGLE_QUOTE_CHAR, SPACE, SPACE_CHAR, SQUARE_BRACKET_CLOSE, SQUARE_BRACKET_OPEN, TEXT_LINE_START, TRUE
-
-
Constructor Summary
Constructors Constructor Description AponReader(java.io.Reader reader)
Instantiates a new AponReader.AponReader(java.lang.String text)
Instantiates a new AponReader.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static Parameters
parse(java.io.File file)
Converts to a Parameters object from a file.static Parameters
parse(java.io.File file, java.lang.String encoding)
Converts to a Parameters object from a file.static <T extends Parameters>
Tparse(java.io.File file, java.lang.String encoding, T parameters)
Converts into a given Parameters object from a file.static <T extends Parameters>
Tparse(java.io.File file, T parameters)
Converts into a given Parameters object from a file.static Parameters
parse(java.io.Reader reader)
Converts to a Parameters object from a character-input stream.static <T extends Parameters>
Tparse(java.io.Reader reader, T parameters)
Converts into a given Parameters object from a character-input stream.static Parameters
parse(java.lang.String text)
Converts an APON formatted string into a Parameters object.static <T extends Parameters>
Tparse(java.lang.String text, java.lang.Class<T> requiredType)
static <T extends Parameters>
Tparse(java.lang.String text, T parameters)
Converts an APON formatted string into a given Parameters object.Parameters
read()
Reads an APON document into aVariableParameters
object.<T extends Parameters>
Tread(T parameters)
Reads an APON formatted document into the specifiedParameters
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 aVariableParameters
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 specifiedParameters
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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.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 stringparameters
- 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 parseencoding
- 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 parseparameters
- 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 parseencoding
- the character encodingparameters
- 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 streamparameters
- the Parameters object- Returns:
- the Parameters object
- Throws:
java.io.IOException
- if reading APON format document fails
-
-