Class AponWriter

java.lang.Object
com.aspectran.utils.apon.AponFormat
com.aspectran.utils.apon.AponWriter
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class AponWriter extends AponFormat implements Flushable, Closeable
Writes an APON object to an output source.

By default, the indentation string is " " (two blanks)

  • 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

      public AponWriter(Writer writer)
      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

      public AponWriter(File file) throws 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:
      IOException - if an I/O error occurs
  • Method Details

    • autoFlush

      public <T extends AponWriter> T autoFlush(boolean autoFlush)
    • prettyPrint

      public <T extends AponWriter> T prettyPrint(boolean prettyPrint)
    • indentString

      public <T extends AponWriter> T indentString(String indentString)
    • nullWritable

      public <T extends AponWriter> T nullWritable(boolean nullWritable)
    • enableValueTypeHints

      public <T extends AponWriter> T enableValueTypeHints(boolean valueTypeHintEnabled)
      Sets whether write a type hint for values.
      Parameters:
      valueTypeHintEnabled - true, write a type hint for values
    • setIndentString

      public void setIndentString(String indentString)
      Specifies the indent string.
      Parameters:
      indentString - the indentation string, by default " " (two blanks).
    • write

      public <T extends AponWriter> T write(Parameters parameters) throws IOException
      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

      public <T extends AponWriter> T write(Parameter parameter) throws IOException
      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

      public <T extends AponWriter> T comment(String message) throws IOException
      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

      public void flush() throws IOException
      Specified by:
      flush in interface Flushable
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • escape

      public static String escape(String str)