Search this API

y.io.graphml.output
Interface GraphMLWriteContext

All Superinterfaces:
Lookup
All Known Implementing Classes:
ChildWriteContext

public interface GraphMLWriteContext
extends Lookup

Interface that defines the context of a GraphML writing context.

All state data that is needed for the writing of a concrete graph instance should go here, allowing all handlers and deserializers to be implemented stateless

 

Method Summary
 java.lang.Object getCurrentObject()
          Returns the most current (i.e. the last element) within the container hierarchy as it is returned by getObjectStack()
 Graph getGraph()
          Returns the currently active graph object
 java.util.Collection getObjectStack()
          Returns the current nesting of graphs and graph elements.
 java.lang.Object getSerializationProperty(java.lang.Object key)
          Get a property value that specifies information about how to handle specific cases
 WriteEventHandler getWriteEvents()
          Returns an implementation of WriteEventHandler that allows to subscribe to various events in the write process.
 XmlWriter getWriter()
          Returns the current XmlWriter implementation.
 void serialize(GraphMLWriteContext context, java.lang.Object item, java.lang.Class serializationType)
          Serialize item to an XML representation.
 void serialize(java.lang.Object item)
          Serialize item to an XML representation.
 
Methods inherited from interface y.io.graphml.Lookup
lookup
 

Method Detail

getObjectStack

java.util.Collection getObjectStack()
Returns the current nesting of graphs and graph elements.

The list contains the user objects which correspond to the graphml elements.

Returns:
A read-only view on the current nesting.

getCurrentObject

java.lang.Object getCurrentObject()
Returns the most current (i.e. the last element) within the container hierarchy as it is returned by getObjectStack()

Returns:
The current (i.e. topmost) graph element that is written.

getWriteEvents

WriteEventHandler getWriteEvents()
Returns an implementation of WriteEventHandler that allows to subscribe to various events in the write process.

Returns:
A WriteEventHandler instance.

getWriter

XmlWriter getWriter()
Returns the current XmlWriter implementation.

Returns:
The current core XML writer

getGraph

Graph getGraph()
Returns the currently active graph object

Returns:
The currently active graph object

getSerializationProperty

java.lang.Object getSerializationProperty(java.lang.Object key)
Get a property value that specifies information about how to handle specific cases

Parameters:
key - The identifier for the property
Returns:
The property value, or null if no such property exists

serialize

void serialize(java.lang.Object item)
               throws GraphMLWriteException
Serialize item to an XML representation.

Parameters:
item - The object that should be serialized.
Throws:
GraphMLWriteException

serialize

void serialize(GraphMLWriteContext context,
               java.lang.Object item,
               java.lang.Class serializationType)
               throws GraphMLWriteException
Serialize item to an XML representation.

This method is reserved for special use cases. Usually, you should just call serialize(Object) instead.

Parameters:
context - The current write context.
item - The object that should be serialized.
serializationType - The actual type of the serialization, in case it differs from the type of item.
Throws:
GraphMLWriteException

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