Class GraphDotTokenWriter
java.lang.Object
de.xima.fc.common.graphdot.GraphDotTokenWriter
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
GraphDotProductionWriter
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.
See GraphDotProductionWriter, for writing individual grammar productions.
See GraphDotModelWriter, for writing POJO models directly.
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()final voidDecreases the indent by one.static GraphDotTokenWriterCreates a new dot graph token writer.static GraphDotTokenWriterforWriter(Writer writer, CharSequence indentChar) Creates a new dot graph token writer.final voidIncreases the indent by one.final voidWrites a comma token.final voidwriteTokenAttributeStatementType(EAttributeStatementType attributeStatementType) Writes the token for the given attribute statement type.final voidWrites a closing angle bracket token.final voidWrites a closing brace token.final voidWrites a closing bracket token.final voidWrites a colon token.final voidwriteTokenCompassPointValue(ECompassPointType compassPoint) Writes a compass point token.final voidWrites a double quote token.final voidwriteTokenEdgeOperation(EEdgeType edgeOp) Writes an edge operation token.final voidWrites am equal sign token.final voidwriteTokenGraphType(EGraphType graphType) Writes a graph type token.final voidwriteTokenIdHtml(CharSequence html) Writes an ID with the given HTML content.final voidWrites an ID with the given literal content.final voidWrites one or more indent tokens, depending on the current indent level.final voidWrites a line break token.final voidWrites an opening angle bracket token.final voidWrites an opening brace token.final voidWrites an opening bracket token.final voidWrites a semicolon token.final voidWrites a white space token.final voidWrites thestricttoken.final voidWrites thesubgraphtoken.
-
Field Details
-
writer
-
-
Method Details
-
close
- 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
Writes 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
Writes a closing angle bracket token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenClosingBrace
Writes a closing brace token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenClosingBracket
Writes a closing bracket token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenColon
Writes a colon token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenCompassPointValue
Writes a compass point token.- Parameters:
compassPoint- Compass point to write.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenDoubleQuote
Writes a double quote token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenEdgeOperation
Writes an edge operation token.- Parameters:
edgeOp- Edge operation to write.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenEqualSign
Writes am equal sign token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenGraphType
Writes a graph type token.- Parameters:
graphType- Graph type to write.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenIdHtml
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
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
Writes one or more indent tokens, depending on the current indent level.- Throws:
IOException- When content could not be written to the writer.- See Also:
-
writeTokenLineBeak
Writes a line break token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenOpeningAngleBracket
Writes an opening angle bracket token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenOpeningBrace
Writes an opening brace token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenOpeningBracket
Writes an opening bracket token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenSemiColon
Writes a semicolon token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenSpace
Writes a white space token.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenStrict
Writes thestricttoken.- Throws:
IOException- When content could not be written to the writer.
-
writeTokenSubGraph
Writes thesubgraphtoken.- Throws:
IOException- When content could not be written to the writer.
-
forWriter
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
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.
-