Package com.aspectran.core.util.apon
Class AponWriter
- java.lang.Object
-
- com.aspectran.core.util.apon.AponFormat
-
- com.aspectran.core.util.apon.AponWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class AponWriter extends AponFormat implements java.io.Flushable, java.io.Closeable
Writes an APON object to an output source.By default, the indentation string is " " (two blanks)
-
-
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 AponWriter()
Instantiates a new AponWriter.AponWriter(java.io.File file)
Instantiates a new AponWriter.AponWriter(java.io.Writer out)
Instantiates a new AponWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
<T extends AponWriter>
Tcomment(java.lang.String message)
Writes a comment to the character-output stream.void
flush()
<T extends AponWriter>
TindentString(java.lang.String indentString)
<T extends AponWriter>
TnullWritable(boolean nullWritable)
<T extends AponWriter>
TprettyPrint(boolean prettyPrint)
void
setIndentString(java.lang.String indentString)
Specifies the indent string.java.lang.String
toString()
<T extends AponWriter>
TvalueTypeHintable(boolean valueTypeHintable)
Sets whether write a type hint for values.<T extends AponWriter>
Twrite(Parameter parameter)
Write a Parameter object to the character-output stream.<T extends AponWriter>
Twrite(Parameters parameters)
Write a Parameters object to the character-output stream.-
Methods inherited from class com.aspectran.core.util.apon.AponFormat
escape, unescape
-
-
-
-
Constructor Detail
-
AponWriter
public AponWriter()
Instantiates a new AponWriter. Pretty printing is enabled by default, and the indent string is set to " " (two spaces).
-
AponWriter
public AponWriter(java.io.Writer out)
Instantiates a new AponWriter. Pretty printing is enabled by default, and the indent string is set to " " (two spaces).- Parameters:
out
- the character-output stream
-
AponWriter
public AponWriter(java.io.File file) throws java.io.IOException
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:
java.io.IOException
- if an I/O error occurs
-
-
Method Detail
-
setIndentString
public void setIndentString(java.lang.String indentString)
Specifies the indent string.- Parameters:
indentString
- the indentation string, by default " " (two blanks).
-
valueTypeHintable
public <T extends AponWriter> T valueTypeHintable(boolean valueTypeHintable)
Sets whether write a type hint for values.- Parameters:
valueTypeHintable
- true, write a type hint for values
-
nullWritable
public <T extends AponWriter> T nullWritable(boolean nullWritable)
-
indentString
public <T extends AponWriter> T indentString(java.lang.String indentString)
-
prettyPrint
public <T extends AponWriter> T prettyPrint(boolean prettyPrint)
-
write
public <T extends AponWriter> T write(Parameters parameters) throws java.io.IOException
Write a Parameters object to the character-output stream.- Parameters:
parameters
- the Parameters object to be converted- Throws:
java.io.IOException
- if an I/O error occurs
-
write
public <T extends AponWriter> T write(Parameter parameter) throws java.io.IOException
Write a Parameter object to the character-output stream.- Parameters:
parameter
- the Parameter object to be converted- Throws:
java.io.IOException
- if an I/O error occurs
-
comment
public <T extends AponWriter> T comment(java.lang.String message) throws java.io.IOException
Writes a comment to the character-output stream.- Parameters:
message
- the comment to write to a character-output stream- Throws:
java.io.IOException
- if an I/O error occurs
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Throws:
java.io.IOException
-
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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-