Interface TextDepictContext

    • Method Detail

      • getDepictStringBuilder

        java.lang.StringBuilder getDepictStringBuilder()
        The string builder that holds the current content being collected, though not necessarily all the content collected. The string builder returned is appropriate for adding content, but may not be a complete representation of all the text collected.
        Returns:
        The string builder that holds the current content being collected for depiction.
      • clearDepictText

        void clearDepictText()
        Clears all data collected for depiction.
      • getDepictText

        java.lang.String getDepictText()
        Returns:
        The string that holds the current content being collected for depiction.
      • isFormatted

        boolean isFormatted()
        Returns:
        Whether output should be formatted. This version returns true.
      • getIndentLevel

        int getIndentLevel()
        Returns:
        The zero-based level of text indentation.
      • setIndentLevel

        void setIndentLevel​(int newIndentLevel)
        Sets the level of text indentation.
        Parameters:
        newIndentLevel - The new zero-based level of text indention.
      • indent

        void indent​(int indentDelta)
        Changes the indent level by the given amount.
        Parameters:
        indentDelta - The amount by which to increase or decrease the indent level.
        See Also:
        getIndentLevel(), setIndentLevel(int)
      • indent

        void indent()
        Increments the indent level.
        See Also:
        indent(int)
      • unindent

        void unindent()
        Decrements the indent level.
        See Also:
        indent(int)
      • getOutputCharset

        java.nio.charset.Charset getOutputCharset()
        Returns:
        The charset currently used for the text output.
      • getOutputContentType

        com.globalmentor.net.ContentType getOutputContentType()
        Returns:
        The current content type of the text output.
      • setOutputContentType

        void setOutputContentType​(com.globalmentor.net.ContentType contentType)
        Sets the content type of the text output.
        Parameters:
        contentType - The content type of the text output.
      • writeLiteral

        void writeLiteral​(java.lang.String text)
                   throws java.io.IOException
        Writes literal text with no encoding. All writing by the controller should use this method.
        Parameters:
        text - The literal text to write.
        Throws:
        java.io.IOException - if there is an error writing the information.
      • write

        void write​(char character)
            throws java.io.IOException
        Writes a character, encoding it as necessary. This method calls writeLiteral(String).
        Parameters:
        character - The character to write.
        Throws:
        java.io.IOException - if there is an error writing the information.
      • write

        void write​(java.lang.String text)
            throws java.io.IOException
        Writes text, encoding it as necessary. This method calls writeLiteral(String).
        Parameters:
        text - The text to write.
        Throws:
        java.io.IOException - if there is an error writing the information.
      • writeIndent

        void writeIndent()
                  throws java.io.IOException
        Writes an indention at the current indention level. If the context is not formatted, no action occurs.
        Throws:
        java.io.IOException - if there is an error writing the information.
        See Also:
        isFormatted(), getIndentLevel()