Package de.xima.fc.common.graphdot
Class GraphDotTokenWriter
- java.lang.Object
-
- de.xima.fc.common.graphdot.GraphDotTokenWriter
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
GraphDotProductionWriter
public class GraphDotTokenWriter extends Object implements AutoCloseable
Writer for creating content conforming to the graphviz dot language syntax specification, see DOT Language.This writer offers low-level methods for writing tokens as defined by the graph dot language.
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
, for writing individual grammar productions.,, for writing POJO models directly.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddecreaseIndent()Decreases the indent by one.static GraphDotTokenWriterforWriter(Writer writer)Creates a new dot graph token writer.static GraphDotTokenWriterforWriter(Writer writer, CharSequence indentChar)Creates a new dot graph token writer.voidincreaseIndent()Increases the indent by one.voidwriterTokenComma()Writes a comma token.voidwriteTokenAttributeStatementType(EAttributeStatementType attributeStatementType)Writes the token for the given attribute statement type.voidwriteTokenClosingAngleBracket()Writes a closing angle bracket token.voidwriteTokenClosingBrace()Writes a closing brace token.voidwriteTokenClosingBracket()Writes a closing bracket token.voidwriteTokenColon()Writes a colon token.voidwriteTokenCompassPointValue(ECompassPointType compassPoint)Writes a compass point token.voidwriteTokenDoubleQuote()Writes a double quote token.voidwriteTokenEdgeOperation(EEdgeType edgeOp)Writes an edge operation token.voidwriteTokenEqualSign()Writes am equal sign token.voidwriteTokenGraphType(EGraphType graphType)Writes a graph type token.voidwriteTokenIdHtml(CharSequence html)Writes an ID with the given HTML content.voidwriteTokenIdLiteral(CharSequence id)Writes an ID with the given literal content.voidwriteTokenIndent()Writes one or more indent tokens, depending on the current indent level.voidwriteTokenLineBeak()Writes a line break token.voidwriteTokenOpeningAngleBracket()Writes an opening angle bracket token.voidwriteTokenOpeningBrace()Writes an opening brace token.voidwriteTokenOpeningBracket()Writes an opening bracket token.voidwriteTokenSemiColon()Writes a semicolon token.voidwriteTokenSpace()Writes a white space token.voidwriteTokenStrict()Writes thestricttoken.voidwriteTokenSubGraph()Writes thesubgraphtoken.
-
-
-
Field Detail
-
writer
protected final Writer writer
-
-
Method Detail
-
close
public final void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
decreaseIndent
public final void decreaseIndent()
Decreases the indent by one.
-
increaseIndent
public final void increaseIndent()
Increases the indent by one.
-
writerTokenComma
public final void writerTokenComma() throws IOExceptionWrites a comma token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenAttributeStatementType
public final void writeTokenAttributeStatementType(EAttributeStatementType attributeStatementType) throws IOException
Writes the token for the given attribute statement type.- Parameters:
attributeStatementType- Type to write.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenClosingAngleBracket
public final void writeTokenClosingAngleBracket() throws IOExceptionWrites a closing angle bracket token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenClosingBrace
public final void writeTokenClosingBrace() throws IOExceptionWrites a closing brace token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenClosingBracket
public final void writeTokenClosingBracket() throws IOExceptionWrites a closing bracket token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenColon
public final void writeTokenColon() throws IOExceptionWrites a colon token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenCompassPointValue
public final void writeTokenCompassPointValue(ECompassPointType compassPoint) throws IOException
Writes a compass point token.- Parameters:
compassPoint- Compass point to write.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenDoubleQuote
public final void writeTokenDoubleQuote() throws IOExceptionWrites a double quote token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenEdgeOperation
public final void writeTokenEdgeOperation(EEdgeType edgeOp) throws IOException
Writes an edge operation token.- Parameters:
edgeOp- Edge operation to write.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenEqualSign
public final void writeTokenEqualSign() throws IOExceptionWrites am equal sign token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenGraphType
public final void writeTokenGraphType(EGraphType graphType) throws IOException
Writes a graph type token.- Parameters:
graphType- Graph type to write.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenIdHtml
public final void writeTokenIdHtml(CharSequence html) throws IOException
Writes an ID with the given HTML content.An ID is one of the following:
- Any string of alphabetic ([a-zA-Z\200-\377]) characters, underscores ('_') or digits([0-9]), not beginning with a digit;
- a numeral [-]?(.[0-9]⁺ | [0-9]⁺(.[0-9]*)? );
- any double-quoted string ("...") possibly containing escaped quotes (\");
- an HTML string (<...>)
- Parameters:
html- An html string.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenIdLiteral
public final void writeTokenIdLiteral(CharSequence id) throws IOException
Writes an ID with the given literal content.An ID is one of the following:
- Any string of alphabetic ([a-zA-Z\200-\377]) characters, underscores ('_') or digits([0-9]), not beginning with a digit;
- a numeral [-]?(.[0-9]⁺ | [0-9]⁺(.[0-9]*)? );
- any double-quoted string ("...") possibly containing escaped quotes (\");
- an HTML string (<...>)
- Parameters:
id- A literal ID to write.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenIndent
public final void writeTokenIndent() throws IOExceptionWrites one or more indent tokens, depending on the current indent level.- Throws:
IOException- When content could not be written to the writer.- See Also:
increaseIndent(),decreaseIndent()
-
writeTokenLineBeak
public final void writeTokenLineBeak() throws IOExceptionWrites a line break token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenOpeningAngleBracket
public final void writeTokenOpeningAngleBracket() throws IOExceptionWrites an opening angle bracket token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenOpeningBrace
public final void writeTokenOpeningBrace() throws IOExceptionWrites an opening brace token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenOpeningBracket
public final void writeTokenOpeningBracket() throws IOExceptionWrites an opening bracket token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenSemiColon
public final void writeTokenSemiColon() throws IOExceptionWrites a semicolon token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenSpace
public final void writeTokenSpace() throws IOExceptionWrites a white space token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenStrict
public final void writeTokenStrict() throws IOExceptionWrites thestricttoken.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenSubGraph
public final void writeTokenSubGraph() throws IOExceptionWrites thesubgraphtoken.- Throws:
IOException- When content could not be written to the writer.
-
forWriter
public static GraphDotTokenWriter forWriter(Writer writer)
Creates a new dot graph token writer. The content is written to the given writer.- Parameters:
writer- Writer to which to write the output.- Returns:
- A new graph dot token writer.
-
forWriter
public static GraphDotTokenWriter forWriter(Writer writer, CharSequence indentChar)
Creates a new dot graph token writer. The content is written to the given writer.- Parameters:
writer- Writer to which to write the output.indentChar- Char sequence to use for indenting.- Returns:
- A new graph dot token writer.
-
-