uk.ac.soton.itinnovation.grid.service.types.jsdl
Class RecognisedElementParser

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.types.jsdl.RecognisedElementParser
Direct Known Subclasses:
Application, DataStaging, JobDescription, JobIdentification, PosixApplication, Resources

public abstract class RecognisedElementParser
extends Object


Constructor Summary
RecognisedElementParser()
           
 
Method Summary
 void addOtherNode(Node node)
          Adds an unsupported node to this part of the JSDL.
protected  void addRecognisedElement(String namespace, String localName)
          Adds an element to the list of recognised elements.
protected  void addRecognisedElements(String namespace, List<String> localNames)
           
protected  void importOtherNodes(Document doc, Element element)
          Appends all the unsupported nodes to the given element.
protected  void parse(Element element)
          Parses all the children of element.
protected abstract  void parseElement(Element e, String namespace, String localName)
           
 void removeOtherNode(Node node)
          Removes an unsupported node that was previously added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecognisedElementParser

public RecognisedElementParser()
Method Detail

addRecognisedElement

protected void addRecognisedElement(String namespace,
                                    String localName)
Adds an element to the list of recognised elements. When a recognised element is seen by the parser, the abstract method parseElement(Element, String, String) is called. Unrecognised elements are added to the otherNodes list.

Parameters:
namespace - The namespace URI of the elemnt
localName - The local name of the element

addRecognisedElements

protected void addRecognisedElements(String namespace,
                                     List<String> localNames)

parse

protected void parse(Element element)
Parses all the children of element. Recognised elements will be sent to parseElement(Element, String, String) and unrecognised elements will be added to the otherNodes list.

Parameters:
element -

addOtherNode

public void addOtherNode(Node node)
Adds an unsupported node to this part of the JSDL. Unsupported nodes will be written in any XML generated by the toXML() method.

Parameters:
node - The node to be added, usually an element. A copy of this node is made and the original is not affected.

removeOtherNode

public void removeOtherNode(Node node)
Removes an unsupported node that was previously added. The node and all its children will be removed if the namespace URI and local name match.

Parameters:
node - The node to be removed

importOtherNodes

protected void importOtherNodes(Document doc,
                                Element element)
Appends all the unsupported nodes to the given element.

Parameters:
doc - A document to be used as a factory for nodes.
element - The parent elements to insert nodes under.

parseElement

protected abstract void parseElement(Element e,
                                     String namespace,
                                     String localName)


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.