Class 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)

    • 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 interface java.io.Flushable
        Throws:
        java.io.IOException
      • close

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object