org.graffiti.plugin.io
Class XMLSerializer

java.lang.Object
  extended by org.graffiti.plugin.io.AbstractIOSerializer
      extended by org.graffiti.plugin.io.XMLSerializer
All Implemented Interfaces:
InputSerializer, OutputSerializer, Serializer, Parametrizable

public class XMLSerializer
extends AbstractIOSerializer

Reads and Writes a graph in XML. TODO: specify the XML format.

Version:
$Revision: 5767 $

Constructor Summary
XMLSerializer()
           
 
Method Summary
 Parameter<?>[] getDefaultParameters()
          Returns the default parameters for this Parametrizable.
 String[] getExtensions()
          Returns the extensions the serializer provides.
 String getName()
          Returns the name (id) of this Parametrizable.
 Parameter<?>[] getParameters()
          Returns a list of Parameter that are set for this Parametrizable.
 Graph read(InputStream in)
          Reads in a graph from the given input stream.
 void read(InputStream in, Graph g)
          Reads in a graph from the given input stream.
 void setParameters(Parameter<?>[] params)
          Sets the parameters for this Parametrizable.
 void write(OutputStream stream, Graph g)
          Writes the contents of the given graph to a stream.
 
Methods inherited from class org.graffiti.plugin.io.AbstractIOSerializer
read, read, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLSerializer

public XMLSerializer()
Method Detail

getExtensions

public String[] getExtensions()
Returns the extensions the serializer provides.

Returns:
DOCUMENT ME!

read

public void read(InputStream in,
                 Graph g)
Reads in a graph from the given input stream.

Specified by:
read in interface InputSerializer
Specified by:
read in class AbstractIOSerializer
Parameters:
in - The input stream to read the graph from.
g - The graph to add the newly read graph to.

write

public void write(OutputStream stream,
                  Graph g)
Writes the contents of the given graph to a stream.

Parameters:
stream - The stream to save the graph to.
g - The graph to save.

read

public Graph read(InputStream in)
           throws IOException
Description copied from class: AbstractIOSerializer
Reads in a graph from the given input stream.

Specified by:
read in interface InputSerializer
Overrides:
read in class AbstractIOSerializer
Parameters:
in - The input stream to read the graph from.
Returns:
The newly read graph.
Throws:
IOException - If an IO error occurs.

getDefaultParameters

public Parameter<?>[] getDefaultParameters()
Description copied from interface: Parametrizable
Returns the default parameters for this Parametrizable.

Returns:
the parametrizable's default parameters

getName

public String getName()
Description copied from interface: Parametrizable
Returns the name (id) of this Parametrizable.

Returns:
DOCUMENT ME!

getParameters

public Parameter<?>[] getParameters()
Description copied from interface: Parametrizable
Returns a list of Parameter that are set for this Parametrizable.

Returns:
a collection of Parameter that are needed by the Parametrizable.

setParameters

public void setParameters(Parameter<?>[] params)
Description copied from interface: Parametrizable
Sets the parameters for this Parametrizable. Must have the same types and order as the array returned by getParameter.



Generated at 2012-05-30 11:00:36 PM CEST