public interface WorkspacePersistenceProvider
getIdentifier().readXML() method
with the XML element.Thus this interface allows any module to serialize and deserialize its data to gephi project files.
In order to have your WorkspacePersistenceProvider called,
you must annotate it with @ServiceProvider(service = WorkspacePersistenceProvider.class, position = xy)
The position parameter is optional but often useful when when you need other WorkspacePersistenceProvider data deserialized before yours.
Workspace| Modifier and Type | Method and Description |
|---|---|
String |
getIdentifier()
Unique XML tag identifier for your
WorkspacePersistenceProvider |
void |
readXML(XMLStreamReader reader,
Workspace workspace)
This is automatically called when a start element with the tag name provided in your
getIdentifier method. |
void |
writeXML(XMLStreamWriter writer,
Workspace workspace)
This is automatically called when saving a project file.
|
void writeXML(XMLStreamWriter writer, Workspace workspace)
This is automatically called when saving a project file.
Your implementation must enclose all your data xml in a tag with the name provided in your getIdentifier method.
writer - XMLStreamWriter for xml serialization of this persistence provider dataworkspace - Current workspace being serializedvoid readXML(XMLStreamReader reader, Workspace workspace)
This is automatically called when a start element with the tag name provided in your getIdentifier method.
Your implementation must detect the tag end element to stop reading.
reader - XMLStreamReader for deserialization of this persistence provider data previously serializedworkspace - Current workspace being deserializedString getIdentifier()
WorkspacePersistenceProviderCopyright © 2007-2012 Gephi Consortium. All Rights Reserved.