Package com.aspectran.utils.apon
Class AponWriter
java.lang.Object
com.aspectran.utils.apon.AponFormat
com.aspectran.utils.apon.AponWriter
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Writes an APON object to an output source.
By default, the indentation string is " " (two blanks)
-
Field Summary
Fields inherited from class com.aspectran.utils.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, SYSTEM_NEW_LINE, TEXT_LINE_START, TRUE
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new AponWriter.AponWriter
(File file) Instantiates a new AponWriter.AponWriter
(Writer writer) Instantiates a new AponWriter. -
Method Summary
Modifier and TypeMethodDescription<T extends AponWriter>
TautoFlush
(boolean autoFlush) void
close()
<T extends AponWriter>
TWrites a comment to the character-output stream.<T extends AponWriter>
TenableValueTypeHints
(boolean valueTypeHintEnabled) Sets whether write a type hint for values.static String
void
flush()
<T extends AponWriter>
TindentString
(String indentString) <T extends AponWriter>
TnullWritable
(boolean nullWritable) <T extends AponWriter>
TprettyPrint
(boolean prettyPrint) void
setIndentString
(String indentString) Specifies the indent string.toString()
<T extends AponWriter>
TWrite a Parameter object to the character-output stream.<T extends AponWriter>
Twrite
(Parameters parameters) Write a Parameters object to the character-output stream.
-
Constructor Details
-
AponWriter
public AponWriter()Instantiates a new AponWriter. Pretty printing is enabled by default, and the indent string is set to " " (two spaces). -
AponWriter
Instantiates a new AponWriter. Pretty printing is enabled by default, and the indent string is set to " " (two spaces).- Parameters:
writer
- the character-output stream
-
AponWriter
Instantiates a new AponWriter. Pretty printing is enabled by default, and the indent string is set to " " (two spaces).- Parameters:
file
- a File object to write to- Throws:
IOException
- if an I/O error occurs
-
-
Method Details
-
autoFlush
-
prettyPrint
-
indentString
-
nullWritable
-
enableValueTypeHints
Sets whether write a type hint for values.- Parameters:
valueTypeHintEnabled
- true, write a type hint for values
-
setIndentString
Specifies the indent string.- Parameters:
indentString
- the indentation string, by default " " (two blanks).
-
write
Write a Parameters object to the character-output stream.- Parameters:
parameters
- the Parameters object to be converted- Throws:
IOException
- if an I/O error occurs
-
write
Write a Parameter object to the character-output stream.- Parameters:
parameter
- the Parameter object to be converted- Throws:
IOException
- if an I/O error occurs
-
comment
Writes a comment to the character-output stream.- Parameters:
message
- the comment to write to a character-output stream- Throws:
IOException
- if an I/O error occurs
-
flush
- Specified by:
flush
in interfaceFlushable
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
toString
-
escape
-