Search this API

y.io.graphml.graph2d
Class PortConstraintOutputHandler

java.lang.Object
  extended by y.io.graphml.graph2d.PortConstraintOutputHandler
All Implemented Interfaces:
OutputHandler

public class PortConstraintOutputHandler
extends java.lang.Object
implements OutputHandler

Output handler responsible for writing PortConstraint data. Port constraint data includes source and target port constraints, as well as source group and target group IDs. Port constraint data must be provided by data providers that are registered with the graph using the following standard look-up keys for port constraints:

 

Constructor Summary
PortConstraintOutputHandler()
           
 
Method Summary
 java.util.Collection getDataTagAttributes()
          Gets the XML attributes that should be added to the data element.
 ObjectStringConverter getEdgeGroupIDConverter(ObjectStringConverter c)
          Returns the converter that is responsible for converting the source or target group ID to a string representation.
 java.util.Collection getKeyDefinitionAttributes()
          Gets the XML attributes that should be added to the key definition in the GraphML key element.
 WritePrecedence getPrecedence()
          Gets the write precedence that is associated with this instance.
 boolean isDefaultValue(GraphMLWriteContext ctx)
          Determines whether in the current context, the value is the default value and therefore no data element needs to be written.
 void setEdgeGroupIDConverter(ObjectStringConverter c)
          Sets the converter that is responsible for converting the source or target group ID to a string representation.
 void writeKeyDefinitionContent(GraphMLWriteContext ctx)
          Writes the contents of the key definition.
 void writeValue(GraphMLWriteContext ctx)
          Actually writes the value for the current context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortConstraintOutputHandler

public PortConstraintOutputHandler()
Method Detail

setEdgeGroupIDConverter

public void setEdgeGroupIDConverter(ObjectStringConverter c)
Sets the converter that is responsible for converting the source or target group ID to a string representation. If no converter is set, the default string conversion toString() of the ID object will be used.


getEdgeGroupIDConverter

public ObjectStringConverter getEdgeGroupIDConverter(ObjectStringConverter c)
Returns the converter that is responsible for converting the source or target group ID to a string representation. If no converter is set, the default string conversion toString() of the ID object will be used.


getPrecedence

public WritePrecedence getPrecedence()
Description copied from interface: OutputHandler
Gets the write precedence that is associated with this instance.

Registered output handlers are written either before or after the (optional) child content of the governing GraphML element.

Specified by:
getPrecedence in interface OutputHandler
Returns:
The write precedence for this instance.
See Also:
WritePrecedence

getKeyDefinitionAttributes

public java.util.Collection getKeyDefinitionAttributes()
Description copied from interface: OutputHandler
Gets the XML attributes that should be added to the key definition in the GraphML key element. The return value should contain instances of GraphMLXmlAttribute that represent the attribute data.

Specified by:
getKeyDefinitionAttributes in interface OutputHandler
Returns:
The key definition attributes.

getDataTagAttributes

public java.util.Collection getDataTagAttributes()
Description copied from interface: OutputHandler
Gets the XML attributes that should be added to the data element. The return value should contain instances of GraphMLXmlAttribute that represent the attribute data.

Specified by:
getDataTagAttributes in interface OutputHandler
Returns:
The attributes for the data element.

isDefaultValue

public boolean isDefaultValue(GraphMLWriteContext ctx)
Description copied from interface: OutputHandler
Determines whether in the current context, the value is the default value and therefore no data element needs to be written.

Specified by:
isDefaultValue in interface OutputHandler
Parameters:
ctx - The context.
Returns:
true if for the current context the default value applies and therefore no data element needs to be written; false otherwise.

writeKeyDefinitionContent

public void writeKeyDefinitionContent(GraphMLWriteContext ctx)
Description copied from interface: OutputHandler
Writes the contents of the key definition.

At the time this method is called, the surrounding 'key' element has already been written. However no 'default' element is written by the framework.

Specified by:
writeKeyDefinitionContent in interface OutputHandler
Parameters:
ctx - The context.

writeValue

public void writeValue(GraphMLWriteContext ctx)
Description copied from interface: OutputHandler
Actually writes the value for the current context.

At the time this method is called, the surrounding 'data' element has already been written.

Specified by:
writeValue in interface OutputHandler
Parameters:
ctx - The context.

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