Package de.xima.fc.common.graphdot
Class GraphDotModelWriter
- java.lang.Object
-
- de.xima.fc.common.graphdot.GraphDotTokenWriter
-
- de.xima.fc.common.graphdot.GraphDotProductionWriter
-
- de.xima.fc.common.graphdot.GraphDotModelWriter
-
- All Implemented Interfaces:
AutoCloseable
public final class GraphDotModelWriter extends GraphDotProductionWriter
Writer for creating content conforming to the graphviz dot language syntax specification, see DOT Language.This writer offers methods named
writeModel*
to write syntax tree POJO models. As such, it offers the highest level API.- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
, for writing individual grammar productions.
,, for writing individual tokens manually.
-
-
Field Summary
-
Fields inherited from class de.xima.fc.common.graphdot.GraphDotTokenWriter
writer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GraphDotModelWriter
forWriter(Writer writer)
Creates a new dot graph model writer.static GraphDotModelWriter
forWriter(Writer writer, CharSequence indentChar)
Creates a new dot graph model writer.void
writeModelAssignment(Assignment assignment)
Writes an assignment model.void
writeModelAssignmentStatement(AssignmentStatement propertyStatement)
Writes an assignment statement model.void
writeModelAttributeList(IGraphDotAttributeList attributeList)
Writes an attribute list model.void
writeModelAttributeStatement(AttributeStatement attributeStatement)
Writes an attribute statement model.void
writeModelEdgeStatement(IGraphDotEdgeStatement<?> edgeStatement)
Write an edge modelvoid
writeModelGraph(IGraphDotGraph<?> graph)
Writes a graph model.void
writeModelNodeId(NodeId nodeId)
Writes a node ID model.void
writeModelNodeStatement(NodeStatement nodeStatement)
Write a node statement model.void
writeModelPort(Port port)
Writes a port model.void
writeModelSubGraph(IGraphDotSubGraph<?,?> subGraph)
Writes a sub graph statement model.void
writeModelSubGraphExpression(IGraphDotSubGraphExpression<?> subGraphExpression)
Writes a sub graph expression model.-
Methods inherited from class de.xima.fc.common.graphdot.GraphDotProductionWriter
markEndOfLine, outputLineBreakIfRequested, writeProductionAssignment, writeProductionAssignment, writeProductionAssignmentStatement, writeProductionAssignmentStatement, writeProductionAttributeList, writeProductionAttributeStatement, writeProductionAttributeStatementEdge, writeProductionAttributeStatementGraph, writeProductionAttributeStatementNode, writeProductionEdgeStatement, writeProductionEdgeStatement, writeProductionEdgeStatementDirected, writeProductionEdgeStatementDirected, writeProductionEdgeStatementDirected, writeProductionEdgeStatementDirected, writeProductionEdgeStatementUndirected, writeProductionEdgeStatementUndirected, writeProductionEdgeStatementUndirected, writeProductionEdgeStatementUndirected, writeProductionEndBlock, writeProductionEndBlockExpression, writeProductionGraphHeader, writeProductionGraphHeaderDirected, writeProductionGraphHeaderDirected, writeProductionGraphHeaderUndirected, writeProductionGraphHeaderUndirected, writeProductionNodeId, writeProductionNodeStatement, writeProductionNodeStatement, writeProductionNodeStatement, writeProductionNodeStatement, writeProductionOpenBlock, writeProductionPort, writeProductionSubGraphHeader, writeProductionSubGraphHeader
-
Methods inherited from class de.xima.fc.common.graphdot.GraphDotTokenWriter
close, decreaseIndent, increaseIndent, writerTokenComma, writeTokenAttributeStatementType, writeTokenClosingAngleBracket, writeTokenClosingBrace, writeTokenClosingBracket, writeTokenColon, writeTokenCompassPointValue, writeTokenDoubleQuote, writeTokenEdgeOperation, writeTokenEqualSign, writeTokenGraphType, writeTokenIdHtml, writeTokenIdLiteral, writeTokenIndent, writeTokenLineBeak, writeTokenOpeningAngleBracket, writeTokenOpeningBrace, writeTokenOpeningBracket, writeTokenSemiColon, writeTokenSpace, writeTokenStrict, writeTokenSubGraph
-
-
-
-
Method Detail
-
writeModelAssignment
public void writeModelAssignment(Assignment assignment) throws IOException
Writes an assignment model.- Parameters:
assignment
- Assignment to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelAssignmentStatement
public void writeModelAssignmentStatement(AssignmentStatement propertyStatement) throws IOException
Writes an assignment statement model.- Parameters:
propertyStatement
- Property statement to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelAttributeList
public void writeModelAttributeList(IGraphDotAttributeList attributeList) throws IOException
Writes an attribute list model.- Parameters:
attributeList
- Attribute list to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelAttributeStatement
public void writeModelAttributeStatement(AttributeStatement attributeStatement) throws IOException
Writes an attribute statement model.- Parameters:
attributeStatement
- Attribute statement to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelEdgeStatement
public void writeModelEdgeStatement(IGraphDotEdgeStatement<?> edgeStatement) throws IOException
Write an edge model- Parameters:
edgeStatement
- Edge statement to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelGraph
public void writeModelGraph(IGraphDotGraph<?> graph) throws IOException
Writes a graph model.- Parameters:
graph
- Graph to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelNodeId
public void writeModelNodeId(NodeId nodeId) throws IOException
Writes a node ID model.- Parameters:
nodeId
- A node ID element to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelNodeStatement
public void writeModelNodeStatement(NodeStatement nodeStatement) throws IOException
Write a node statement model.- Parameters:
nodeStatement
- Node statement to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelPort
public void writeModelPort(Port port) throws IOException
Writes a port model.- Parameters:
port
- Port to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelSubGraph
public void writeModelSubGraph(IGraphDotSubGraph<?,?> subGraph) throws IOException
Writes a sub graph statement model.- Parameters:
subGraph
- Sub graph statement to write.- Throws:
IOException
- When content could not be written to the writer.
-
writeModelSubGraphExpression
public void writeModelSubGraphExpression(IGraphDotSubGraphExpression<?> subGraphExpression) throws IOException
Writes a sub graph expression model.- Parameters:
subGraphExpression
- Sub graph expression to write.- Throws:
IOException
- When content could not be written to the writer.
-
forWriter
public static GraphDotModelWriter forWriter(Writer writer)
Creates a new dot graph model writer. The content is written to the given writer.- Parameters:
writer
- Writer to which to write the output.- Returns:
- A new graph dot model writer.
-
forWriter
public static GraphDotModelWriter forWriter(Writer writer, CharSequence indentChar)
Creates a new dot graph model 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 model writer.
-
-