Packagecom.yworks.io.graphml.reader
Interfacepublic interface IGraphItemFactory
Implementors DefaultGraphElementFactory

This interface defines a factory for the creation of graphs and graph elements. It contains a factory method for each graph element defined in the GraphML format. The factory methods are called along the parsing process of the input data and are supposed to return the corresponding user objects for each graph or graph element.



Public Properties
 PropertyDefined By
  clearGraphBeforeRead : Boolean
Whether to clear an existing graph instance before reading If set to true, an exisisting graph instance will be cleared before the graph is read into this instance, otherwise the loaded raph will be merged into the existing one.
IGraphItemFactory
Public Methods
 MethodDefined By
  
createEdge(context:GraphMLParseContext, id:String, source:Object, target:Object, sourcePort:Object, targetPort:Object, directed:Boolean):Object
Returns a user object representing an edge.
IGraphItemFactory
  
createGraph(context:GraphMLParseContext, id:String, edgeDefault:String):Object
Returns a user object which represents a graph.
IGraphItemFactory
  
Returns the the top-level container of all data.
IGraphItemFactory
  
createLabel(context:GraphMLParseContext, item:Object):Object
Returns a user object which represents a label.
IGraphItemFactory
  
createNode(context:GraphMLParseContext, id:String):Object
Returns a user object which represents a node.
IGraphItemFactory
  
createPort(context:GraphMLParseContext, name:String, owner:Object):Object
Returns a user object which represents a port.
IGraphItemFactory
Property Detail
clearGraphBeforeReadproperty
clearGraphBeforeRead:Boolean

Whether to clear an existing graph instance before reading

If set to true, an exisisting graph instance will be cleared before the graph is read into this instance, otherwise the loaded raph will be merged into the existing one.


Implementation
    public function get clearGraphBeforeRead():Boolean
    public function set clearGraphBeforeRead(value:Boolean):void
Method Detail
createEdge()method
public function createEdge(context:GraphMLParseContext, id:String, source:Object, target:Object, sourcePort:Object, targetPort:Object, directed:Boolean):Object

Returns a user object representing an edge.

Parameters

context:GraphMLParseContext — the current parse context.
 
id:String — the identifier of the edge as defined in the input data. May be null if no id has been specified.
 
source:Object — the user object representing the source node of the edge.
 
target:Object — the user object representing the target node of the edge.
 
sourcePort:Object — the user object representing the source port of the edge.
 
targetPort:Object — the user object representing the target port of the edge.
 
directed:Boolean — indicates whether the edge is directed or not.

Returns
Object — a user object representing an edge.
createGraph()method 
public function createGraph(context:GraphMLParseContext, id:String, edgeDefault:String):Object

Returns a user object which represents a graph.

Parameters

context:GraphMLParseContext — the current parse context.
 
id:String — the identifier of the graph as defined in the input data. May be null if no id has been specified.
 
edgeDefault:String — indicates whether edges are directed per default.

Returns
Object — a user object representing a graph.
createGraphML()method 
public function createGraphML(context:GraphMLParseContext):Object

Returns the the top-level container of all data. This method is called when the graphml element is parsed. The return value of this method will be returned by parse method of the parser.

Parameters

context:GraphMLParseContext — the current parse context.

Returns
Object — a user object for the entire graphml-content.
createLabel()method 
public function createLabel(context:GraphMLParseContext, item:Object):Object

Returns a user object which represents a label.

Parameters

context:GraphMLParseContext — the current parse context.
 
item:Object — the label owner

Returns
Object — a user object representing a label.
createNode()method 
public function createNode(context:GraphMLParseContext, id:String):Object

Returns a user object which represents a node.

Parameters

context:GraphMLParseContext
 
id:String — the identifier of the node as defined in the input data.

Returns
Object — a user object representing a node.
createPort()method 
public function createPort(context:GraphMLParseContext, name:String, owner:Object):Object

Returns a user object which represents a port.

Parameters

context:GraphMLParseContext — the current parse context.
 
name:String — the identifier of the port as defined in the input data.
 
owner:Object — the port owner

Returns
Object — a user object representing a port.