Search this API

y.io.graphml.graph2d
Class TableGroupNodeRealizerSerializer

java.lang.Object
  extended by y.io.graphml.graph2d.AbstractNodeRealizerSerializer
      extended by y.io.graphml.graph2d.GenericNodeRealizerSerializer
          extended by y.io.graphml.graph2d.GenericGroupNodeRealizerSerializer
              extended by y.io.graphml.graph2d.TableGroupNodeRealizerSerializer
All Implemented Interfaces:
NodeRealizerSerializer

public class TableGroupNodeRealizerSerializer
extends GenericGroupNodeRealizerSerializer

Serializer for instances of TableGroupNodeRealizer.

As special feature, this serializer optionally uses lenient label parsing. That means all GraphMLParseExceptions and RuntimeExceptions thrown during the parsing of label data are caught and ignored.

See Also:
isLenientLabelParsingEnabled()
 
Your browser does not support SVG content.

Nested Class Summary
 
Nested classes/interfaces inherited from class y.io.graphml.graph2d.GenericNodeRealizerSerializer
GenericNodeRealizerSerializer.ConfigurationFactory
 
Constructor Summary
TableGroupNodeRealizerSerializer()
          Initializes a new TableGroupNodeRealizerSerializer for strict label parsing.
TableGroupNodeRealizerSerializer(boolean lenientLabelParsing)
          Initializes a new TableGroupNodeRealizerSerializer.
 
Method Summary
 java.lang.String getName()
          Returns the name of the XML element tag which denotes this type of realizer.
 java.lang.Class getRealizerClass()
          Returns the class of which the realizer is an instance of.
 boolean isLenientLabelParsingEnabled()
          Determines whether this serializer uses lenient or strict label parsing.
 void parse(NodeRealizer nr, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses the properties into an instance of NodeRealizer.
protected  void parseColumn(TableGroupNodeRealizer.Column column, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses a single Column element storing geometric and structural information for the specified column.
protected  void parseLabel(NodeRealizer realizer, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses a single NodeLabel element.
protected  void parseRow(TableGroupNodeRealizer.Row row, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses a single Row element storing geometric and structural information for the specified row.
 void parseTable(TableGroupNodeRealizer realizer, org.w3c.dom.Node domNode, GraphMLParseContext context)
          Parses the Table element storing the tabular information for the specified realizer.
 void write(NodeRealizer nr, XmlWriter writer, GraphMLWriteContext context)
          Writes the realizer element's content.
protected  void writeColumn(TableGroupNodeRealizer.Column column, XmlWriter writer, GraphMLWriteContext context)
          Writes nested Column elements as appropriate for the specified column.
protected  void writeNodeLabel(NodeLabel label, XmlWriter writer, GraphMLWriteContext context)
          Writes a single NodeLabel element.
protected  void writeRow(TableGroupNodeRealizer.Row row, XmlWriter writer, GraphMLWriteContext context)
          Writes nested Row elements as appropriate for the specified row.
protected  void writeTable(TableGroupNodeRealizer realizer, XmlWriter writer, GraphMLWriteContext context)
          Writes a single Table element storing the tabular information associated to the specified realizer including default settings for (minimum) column width and (minimum) row height.
 
Methods inherited from class y.io.graphml.graph2d.GenericNodeRealizerSerializer
getNamespaceURI, getObjectStringConverter, parseStyleProperties, parseUserData, writeAttributes, writeStyleProperties, writeUserData
 
Methods inherited from class y.io.graphml.graph2d.AbstractNodeRealizerSerializer
canHandle, canHandle, createRealizerInstance, getNamespacePrefix, parseNodePorts, writeBorder, writeFill, writeNodePorts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableGroupNodeRealizerSerializer

public TableGroupNodeRealizerSerializer()
Initializes a new TableGroupNodeRealizerSerializer for strict label parsing. Invoking this constructor is equivalent to
new TableGroupNodeRealizerSerializer(false)


TableGroupNodeRealizerSerializer

public TableGroupNodeRealizerSerializer(boolean lenientLabelParsing)
Initializes a new TableGroupNodeRealizerSerializer.

Parameters:
lenientLabelParsing - if true, fault-tolerant label parsing is enabled; otherwise strict label parsing is used.
Method Detail

isLenientLabelParsingEnabled

public boolean isLenientLabelParsingEnabled()
Determines whether this serializer uses lenient or strict label parsing. With lenient label parsing, all GraphMLParseExceptions and RuntimeExceptions thrown during the parsing of label data are caught and ignored.

Returns:
true if label parsing is lenient; false otherwise.

getName

public java.lang.String getName()
Description copied from interface: NodeRealizerSerializer
Returns the name of the XML element tag which denotes this type of realizer.

Specified by:
getName in interface NodeRealizerSerializer
Overrides:
getName in class GenericGroupNodeRealizerSerializer
Returns:
The name of the XML element

getRealizerClass

public java.lang.Class getRealizerClass()
Description copied from interface: NodeRealizerSerializer
Returns the class of which the realizer is an instance of.

Specified by:
getRealizerClass in interface NodeRealizerSerializer
Overrides:
getRealizerClass in class GenericGroupNodeRealizerSerializer
Returns:
The target class of the realizer

write

public void write(NodeRealizer nr,
                  XmlWriter writer,
                  GraphMLWriteContext context)
           throws GraphMLWriteException
Description copied from interface: NodeRealizerSerializer
Writes the realizer element's content.

Specified by:
write in interface NodeRealizerSerializer
Overrides:
write in class GenericGroupNodeRealizerSerializer
Parameters:
nr - The Realizer to write.
writer - The XmlWriter for the serialization.
context - The current write context.
Throws:
GraphMLWriteException

writeTable

protected void writeTable(TableGroupNodeRealizer realizer,
                          XmlWriter writer,
                          GraphMLWriteContext context)
Writes a single Table element storing the tabular information associated to the specified realizer including default settings for (minimum) column width and (minimum) row height.

Parameters:
realizer - the TableGroupNodeRealize whose tabular data is serialized.
writer - the target XmlWriter.
context - the current GraphMLWriteContext.

writeColumn

protected void writeColumn(TableGroupNodeRealizer.Column column,
                           XmlWriter writer,
                           GraphMLWriteContext context)
Writes nested Column elements as appropriate for the specified column. The root Column element stores the column's geometric data.

Parameters:
column - the Column instance to be serialized.
writer - the target XmlWriter.
context - the current GraphMLWriteContext.

writeRow

protected void writeRow(TableGroupNodeRealizer.Row row,
                        XmlWriter writer,
                        GraphMLWriteContext context)
Writes nested Row elements as appropriate for the specified row. The root Row element stores the row's geometric data.

Parameters:
row - the Row instance to be serialized.
writer - the target XmlWriter.
context - the current GraphMLWriteContext.

writeNodeLabel

protected void writeNodeLabel(NodeLabel label,
                              XmlWriter writer,
                              GraphMLWriteContext context)
                       throws GraphMLWriteException
Writes a single NodeLabel element. Overwritten to support TableGroupNodeRealizer.ColumnNodeLabelModel and TableGroupNodeRealizer.RowNodeLabelModel.

Overrides:
writeNodeLabel in class AbstractNodeRealizerSerializer
Parameters:
label - the NodeLabel to write.
writer - the target XmlWriter.
context - the current GraphMLWriteContext.
Throws:
GraphMLWriteException

parse

public void parse(NodeRealizer nr,
                  org.w3c.dom.Node domNode,
                  GraphMLParseContext context)
           throws GraphMLParseException
Description copied from interface: NodeRealizerSerializer
Parses the properties into an instance of NodeRealizer.

Specified by:
parse in interface NodeRealizerSerializer
Overrides:
parse in class GenericGroupNodeRealizerSerializer
Parameters:
nr - An existing NodeRealizer instance which is configured.
domNode - The XML node containing the realizer data.
context - The current parse context.
Throws:
GraphMLParseException

parseTable

public void parseTable(TableGroupNodeRealizer realizer,
                       org.w3c.dom.Node domNode,
                       GraphMLParseContext context)
Parses the Table element storing the tabular information for the specified realizer.

Parameters:
realizer - the TableGroupNodeRealizer whose tabular information is deserialized.
domNode - the XML node containing the table data.
context - the current GraphMLParseContext.

parseColumn

protected void parseColumn(TableGroupNodeRealizer.Column column,
                           org.w3c.dom.Node domNode,
                           GraphMLParseContext context)
Parses a single Column element storing geometric and structural information for the specified column.

Parameters:
column - the Column instance to store the deserialized data.
domNode - the XML node containing the column data.
context - the current GraphMLParseContext.

parseRow

protected void parseRow(TableGroupNodeRealizer.Row row,
                        org.w3c.dom.Node domNode,
                        GraphMLParseContext context)
Parses a single Row element storing geometric and structural information for the specified row.

Parameters:
row - the Row instance to store the deserialized data.
domNode - the XML node containing the row data.
context - the current GraphMLParseContext.

parseLabel

protected void parseLabel(NodeRealizer realizer,
                          org.w3c.dom.Node domNode,
                          GraphMLParseContext context)
                   throws GraphMLParseException
Parses a single NodeLabel element. Overwritten to support TableGroupNodeRealizer.ColumnNodeLabelModel and TableGroupNodeRealizer.RowNodeLabelModel.

Overrides:
parseLabel in class AbstractNodeRealizerSerializer
Parameters:
realizer - the realizer that will hold the created label.
domNode - the XML node containing the label data.
context - the current GraphMLParseContext.
Throws:
GraphMLParseException

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.