cwi.GraphXML.Elements
Class ApplicationData

java.lang.Object
  extended by cwi.GraphXML.Elements.ApplicationData
All Implemented Interfaces:
java.io.Serializable

public class ApplicationData
extends java.lang.Object
implements java.io.Serializable

Application dependent data, which can be attached to a full GraphXML specification, to a graph, a node, edge, an editing element, etc. Setting of the values is class protected; only the retrieval is meant to be public.

All data can have a null value; they are assigned real objects only if there is something to put there (e.g., the arrays are not defaulted to zero length arrays, Strings are not defaulted to zero length strings, etc.) While this is a bit disagreeable for the user, it avoids unnecessary "new" operations, which can be time consuming.

Author:
Ivan Herman
See Also:
Serialized Form

Constructor Summary
protected ApplicationData(java.lang.String l, java.lang.String d, Reference[] drs, java.util.Properties prs, java.util.Properties graphPrs)
           
 
Method Summary
static ApplicationData create(org.w3c.dom.NodeList children, ParserError parserError)
          Collect the application-dependent element data for a specific node.
static ApplicationData create(org.w3c.dom.Node element, ParserError parserError)
          Collect the application-dependent element data for a specific node.
 java.lang.String getData()
          Get data.
 Reference[] getDatarefs()
          Get the data references.
 java.util.Properties getGraphSpecificProperties()
          Get graph-specific properties.
 java.lang.String getLabel()
          Get the label.
 java.util.Properties getProperties()
          Get properties.
 java.lang.String toString()
          Overrides the usual routine to make a rough print of the content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApplicationData

protected ApplicationData(java.lang.String l,
                          java.lang.String d,
                          Reference[] drs,
                          java.util.Properties prs,
                          java.util.Properties graphPrs)
Method Detail

getLabel

public java.lang.String getLabel()
Get the label.


getDatarefs

public Reference[] getDatarefs()
Get the data references.


getData

public java.lang.String getData()
Get data.


getProperties

public java.util.Properties getProperties()
Get properties. The result is a java.util.Properties instance.


getGraphSpecificProperties

public java.util.Properties getGraphSpecificProperties()
Get graph-specific properties. The result is a java.util.Properties instance.


create

public static ApplicationData create(org.w3c.dom.Node element,
                                     ParserError parserError)
Collect the application-dependent element data for a specific node.

Parameters:
element - the GraphXML element whose data are to be collected
parserError - the parser in charge; used to generate error messages
Returns:
a new Application Data or null

create

public static ApplicationData create(org.w3c.dom.NodeList children,
                                     ParserError parserError)
Collect the application-dependent element data for a specific node.

Parameters:
children - list of children (possibly) containing application data
parserError - the parser in charge; used to generate error messages
Returns:
a new Application Data or null

toString

public java.lang.String toString()
Overrides the usual routine to make a rough print of the content.

Overrides:
toString in class java.lang.Object