|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for roundtrip support classes.
This interface defines methods to read and write GraphML. Also it provides a method to create a graph suited for roundtripping.
Method Summary | |
void |
addMapper(java.lang.Object tag,
java.lang.String name,
KeyType valueType,
KeyScope scope)
Adds integrated support for the round tripping of simple data associated with graph elements. |
void |
addObjectMapper(java.lang.Object tag,
KeyScope scope,
SerializationHandler serializer,
DeserializationHandler deserializer)
Adds integrated support for the round tripping of complex data associated with graph elements. |
LayoutGraph |
createRoundtripGraph()
Creates the graph that should be used for round tripping. |
boolean |
isSupportUserTags()
Whether to support user tags. |
void |
readGraph(java.io.InputStream is,
Graph graph)
Reads the graph from the given stream using the current handler. |
void |
readGraph(java.net.URL url,
Graph graph)
Reads the graph from the given url using the current handler. |
void |
sendError(java.lang.Throwable e,
java.io.OutputStream outputStream)
Send an error to the client. |
void |
sendGraph(Graph graph,
java.io.OutputStream os,
java.lang.String outputEncoding)
Writes the current graph to the stream in GraphML format using the provided encoding. |
void |
setSupportUserTags(boolean supportUserTags)
Whether to support user tags. |
Method Detail |
public void readGraph(java.io.InputStream is, Graph graph) throws java.io.IOException
is
- the stream to use - the encoding should be UTF-8graph
- the graph to read the result in.
java.io.IOException
- if an io exception occurred.public void readGraph(java.net.URL url, Graph graph) throws java.io.IOException
url
- the URL to usegraph
- the graph to read the result in.
java.io.IOException
- if an io exception occurred.public void sendGraph(Graph graph, java.io.OutputStream os, java.lang.String outputEncoding) throws java.io.IOException
graph
- The current graph.os
- The stream to write the graph to.
java.io.IOException
- If something goes wrong during GraphML export.public LayoutGraph createRoundtripGraph()
public void sendError(java.lang.Throwable e, java.io.OutputStream outputStream) throws java.io.IOException
<?xml version="1.0" encoding="UTF-8"?> <response> <errors> <error> <![CDATA[ error message ]]> </error> </errors> </response>
e
- The error.outputStream
- the stream to write the error to - this stream will not be closed.
java.io.IOException
- If writing to the response writer fails.public void addMapper(java.lang.Object tag, java.lang.String name, KeyType valueType, KeyScope scope)
DataMap
will be automatically registered using the provided
key on the graph instances created by createRoundtripGraph()
.
tag
- The tag to use for the DataMap
that can be queried from the graph's instance
using Graph.getDataProvider(Object)
.name
- The name to use for the data in the GraphML file.valueType
- A KeyType
describing the type of the data.scope
- A KeyScope
describing the scope of the data.public void addObjectMapper(java.lang.Object tag, KeyScope scope, SerializationHandler serializer, DeserializationHandler deserializer)
DataMap
will be automatically registered using the provided
key on the graph instances created by createRoundtripGraph()
.
tag
- The tag to use for the DataMap
that can be queried from the graph's instance
using Graph.getDataProvider(Object)
.scope
- A KeyScope
describing the scope of the data.serializer
- The serializer instance that will be used for writing the complex data objects.deserializer
- The deserializer instance that will be used for reading the complex data objects.public boolean isSupportUserTags()
true
if user tags will be read / sent.public void setSupportUserTags(boolean supportUserTags)
Default is false
supportUserTags
- true
if user tags will be read / sent.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |