spase.parser110
Class Description

java.lang.Object
  extended by spase.parser110.Description

public class Description
extends java.lang.Object

A container of resource description.


Constructor Summary
Description()
           
 
Method Summary
 void addResource(Resource resource)
          Add a resource to the description
 void clear()
          Clear the contents.
 void dump()
          Print the contents of the description.
 int getIndexOf(java.lang.String className, int stopAt)
          Return a string with an XML representation of all resources
 java.util.ArrayList<Resource> getResources()
          Get the ArrayList of resource descriptions.
 java.lang.String getVersion()
          Get the version of the SPASE data model desclared in the description.
 java.lang.String getXMLDocument(int n)
          Return a string with an XML representation of all resources
 java.lang.String getXMLDocument(int n, java.lang.String path, int key)
          Return a string with an XML representation of all resources
static void main(java.lang.String[] args)
          Entry point for testing.
 void parse(java.lang.String pathname)
          Parse a description.
 void populate(org.w3c.dom.Document document)
          Walk the nodes of the Document and populate the resource classes.
 void processNode(org.w3c.dom.Node node)
          Walk the nodes of the Document and populate the resource classes.
 void processSpase(org.w3c.dom.Node node)
          Walk the nodes of the "Spase" object in a Document and populate the resource classes.
 void removeResource(int index)
          Remove a resource from the description
 int size()
          Get the the number of resources in this description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Description

public Description()
Method Detail

main

public static void main(java.lang.String[] args)
Entry point for testing.

Since:
1.0

clear

public void clear()
           throws java.lang.Exception
Clear the contents.

Throws:
java.lang.Exception
Since:
1.0

parse

public void parse(java.lang.String pathname)
           throws java.lang.Exception
Parse a description.

Throws:
java.lang.Exception
Since:
1.0

populate

public void populate(org.w3c.dom.Document document)
              throws java.lang.Exception
Walk the nodes of the Document and populate the resource classes.

Parameters:
document - the Document containing a parsed XML file.
Throws:
java.lang.Exception
Since:
1.0

processNode

public void processNode(org.w3c.dom.Node node)
                 throws java.lang.Exception
Walk the nodes of the Document and populate the resource classes.

Parameters:
node - the Node.
Throws:
java.lang.Exception
Since:
1.0

processSpase

public void processSpase(org.w3c.dom.Node node)
                  throws java.lang.Exception
Walk the nodes of the "Spase" object in a Document and populate the resource classes.

Parameters:
node - the Node.
Throws:
java.lang.Exception
Since:
1.0

getXMLDocument

public java.lang.String getXMLDocument(int n)
Return a string with an XML representation of all resources

Since:
1.0

getXMLDocument

public java.lang.String getXMLDocument(int n,
                                       java.lang.String path,
                                       int key)
Return a string with an XML representation of all resources

Since:
1.0

getIndexOf

public int getIndexOf(java.lang.String className,
                      int stopAt)
Return a string with an XML representation of all resources

Since:
1.0

addResource

public void addResource(Resource resource)
Add a resource to the description

Since:
1.0

removeResource

public void removeResource(int index)
Remove a resource from the description

Since:
1.0

getResources

public java.util.ArrayList<Resource> getResources()
Get the ArrayList of resource descriptions.

Since:
1.0

getVersion

public java.lang.String getVersion()
Get the version of the SPASE data model desclared in the description.

Since:
1.0

size

public int size()
Get the the number of resources in this description.

Since:
1.0

dump

public void dump()
Print the contents of the description.

Since:
1.0