java.io.Closeable, java.io.Flushable, java.lang.AutoCloseablepublic class AponWriter extends AponFormat implements java.io.Flushable, java.io.Closeable
If pretty-printing is enabled, includes spaces, tabs to make the format more readable. By default, pretty-printing is enabled, and the indent string is a tab character.
COMMENT_LINE_START, CURLY_BRACKET_CLOSE, CURLY_BRACKET_OPEN, DOUBLE_QUOTE_CHAR, ESCAPE_CHAR, FALSE, INDENT_STRING, NAME_VALUE_SEPARATOR, 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 | Description |
|---|---|
AponWriter(java.io.File file) |
Instantiates a new AponWriter.
|
AponWriter(java.io.File file,
boolean append) |
Instantiates a new AponWriter.
|
AponWriter(java.io.Writer writer) |
Instantiates a new AponWriter.
|
AponWriter(java.io.Writer writer,
boolean prettyPrint) |
Instantiates a new AponWriter.
|
AponWriter(java.io.Writer writer,
java.lang.String indentString) |
Instantiates a new AponWriter.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes the writer.
|
void |
comment(java.lang.String describe) |
Writes a comment to the character-output stream.
|
void |
flush() |
|
void |
setIndentString(java.lang.String indentString) |
|
void |
setNoQuotes(boolean noQuotes) |
Sets whether wrap a string in quotes.
|
void |
setNullWrite(boolean nullWrite) |
Sets whether to write a null parameter.
|
void |
setPrettyPrint(boolean prettyPrint) |
|
void |
setTypeHintWrite(boolean typeHintWrite) |
Sets whether write a type hint for values.
|
static java.lang.String |
stringify(Parameters parameters) |
Converts a Parameters object to an APON formatted string.
|
static java.lang.String |
stringify(Parameters parameters,
boolean prettyPrint) |
Converts a Parameters object to an APON formatted string.
|
static java.lang.String |
stringify(Parameters parameters,
java.lang.String indentString) |
Converts a Parameters object to an APON formatted string.
|
void |
write(Parameter parameter) |
Write a Parameter object to the character-output stream.
|
void |
write(Parameters parameters) |
Write a Parameters object to the character-output stream.
|
escape, unescapepublic AponWriter(java.io.Writer writer)
writer - the character-output streampublic AponWriter(java.io.Writer writer,
boolean prettyPrint)
writer - the character-output streamprettyPrint - enables or disables pretty-printingpublic AponWriter(java.io.Writer writer,
java.lang.String indentString)
writer - the character-output streamindentString - the string that should be used for indentation when pretty-printing is enabledpublic AponWriter(java.io.File file)
throws java.io.IOException
file - a File object to write tojava.io.IOException - if an I/O error occurspublic AponWriter(java.io.File file,
boolean append)
throws java.io.IOException
file - a File object to write toappend - if true, then bytes will be written
to the end of the file rather than the beginningjava.io.IOException - if an I/O error occurspublic void setPrettyPrint(boolean prettyPrint)
public void setIndentString(java.lang.String indentString)
public void setNoQuotes(boolean noQuotes)
noQuotes - true, wrap a string in quotespublic void setNullWrite(boolean nullWrite)
nullWrite - true, write a null parameterpublic void setTypeHintWrite(boolean typeHintWrite)
typeHintWrite - true, write a type hint for valuespublic void write(Parameters parameters) throws java.io.IOException
parameters - the Parameters object to be convertedjava.io.IOException - if an I/O error occurspublic void write(Parameter parameter) throws java.io.IOException
parameter - the Parameter object to be convertedjava.io.IOException - if an I/O error occurspublic void comment(java.lang.String describe)
throws java.io.IOException
describe - the comment to write to a character-output streamjava.io.IOException - if an I/O error occurspublic void flush()
throws java.io.IOException
flush in interface java.io.Flushablejava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOException - if an I/O error occurspublic static java.lang.String stringify(Parameters parameters)
parameters - the Parameters object to be convertedpublic static java.lang.String stringify(Parameters parameters, boolean prettyPrint)
parameters - the Parameters object to be convertedprettyPrint - enables or disables pretty-printingpublic static java.lang.String stringify(Parameters parameters, java.lang.String indentString)
parameters - the Parameters object to be convertedindentString - the string that should be used for indentation when pretty-printing is enabledCopyright © 2008–2018 The Aspectran Project. All rights reserved.