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 void
close()
void
decreaseIndent()
Decreases the indent by one.static GraphDotTokenWriter
forWriter(Writer writer)
Creates a new dot graph token writer.static GraphDotTokenWriter
forWriter(Writer writer, CharSequence indentChar)
Creates a new dot graph token writer.void
increaseIndent()
Increases the indent by one.void
writerTokenComma()
Writes a comma token.void
writeTokenAttributeStatementType(EAttributeStatementType attributeStatementType)
Writes the token for the given attribute statement type.void
writeTokenClosingAngleBracket()
Writes a closing angle bracket token.void
writeTokenClosingBrace()
Writes a closing brace token.void
writeTokenClosingBracket()
Writes a closing bracket token.void
writeTokenColon()
Writes a colon token.void
writeTokenCompassPointValue(ECompassPointType compassPoint)
Writes a compass point token.void
writeTokenDoubleQuote()
Writes a double quote token.void
writeTokenEdgeOperation(EEdgeType edgeOp)
Writes an edge operation token.void
writeTokenEqualSign()
Writes am equal sign token.void
writeTokenGraphType(EGraphType graphType)
Writes a graph type token.void
writeTokenIdHtml(CharSequence html)
Writes an ID with the given HTML content.void
writeTokenIdLiteral(CharSequence id)
Writes an ID with the given literal content.void
writeTokenIndent()
Writes one or more indent tokens, depending on the current indent level.void
writeTokenLineBeak()
Writes a line break token.void
writeTokenOpeningAngleBracket()
Writes an opening angle bracket token.void
writeTokenOpeningBrace()
Writes an opening brace token.void
writeTokenOpeningBracket()
Writes an opening bracket token.void
writeTokenSemiColon()
Writes a semicolon token.void
writeTokenSpace()
Writes a white space token.void
writeTokenStrict()
Writes thestrict
token.void
writeTokenSubGraph()
Writes thesubgraph
token.
-
-
-
Field Detail
-
writer
protected final Writer writer
-
-
Method Detail
-
close
public final void close() throws IOException
- Specified by:
close
in 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 IOException
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
public final void writeTokenClosingAngleBracket() throws IOException
Writes a closing angle bracket token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenClosingBrace
public final void writeTokenClosingBrace() throws IOException
Writes a closing brace token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenClosingBracket
public final void writeTokenClosingBracket() throws IOException
Writes a closing bracket token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenColon
public final void writeTokenColon() throws IOException
Writes 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 IOException
Writes 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 IOException
Writes 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 IOException
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:
increaseIndent()
,decreaseIndent()
-
writeTokenLineBeak
public final void writeTokenLineBeak() throws IOException
Writes a line break token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenOpeningAngleBracket
public final void writeTokenOpeningAngleBracket() throws IOException
Writes an opening angle bracket token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenOpeningBrace
public final void writeTokenOpeningBrace() throws IOException
Writes an opening brace token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenOpeningBracket
public final void writeTokenOpeningBracket() throws IOException
Writes an opening bracket token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenSemiColon
public final void writeTokenSemiColon() throws IOException
Writes a semicolon token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenSpace
public final void writeTokenSpace() throws IOException
Writes a white space token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenStrict
public final void writeTokenStrict() throws IOException
Writes thestrict
token.- Throws:
IOException
- When content could not be written to the writer.
-
writeTokenSubGraph
public final void writeTokenSubGraph() throws IOException
Writes thesubgraph
token.- 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.
-
-