|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
edu.isi.pegasus.planner.parser.Parser
edu.isi.pegasus.planner.parser.StackBasedXMLParser
public abstract class StackBasedXMLParser
An abstract base class that XML Parsers can use if they use stack internally to store the elements encountered while parsing XML documents using SAX
| Field Summary | |
|---|---|
protected int |
mDepth
Count the depths of elements in the document |
protected boolean |
mParsingDone
A boolean indicating that parsing is done. |
protected Stack |
mStack
The stack of objects kept around. |
| Fields inherited from class edu.isi.pegasus.planner.parser.Parser |
|---|
DEFAULT_PARSER_NAME, mAdjFName, mLocator, mLogger, mLogMsg, mParser, mProps, mTextContent, mTextString |
| Constructor Summary | |
|---|---|
StackBasedXMLParser(PegasusBag bag)
The overloaded constructor. |
|
| Method Summary | |
|---|---|
void |
attributeNotSupported(String element,
String attribute,
String value)
This is called when an attribute is encountered for an element that is valid in the schema context but not supported right now. |
void |
complain(String element,
String attribute,
String value)
This is called when an attribute is encountered for an element that is invalid from the schema context and is not supported. |
abstract Object |
createObject(String element,
List names,
List values)
Composes the SiteData object corresponding to the element
name in the XML document. |
void |
endDocument()
This is called automatically when the end of the XML file is reached. |
void |
endElement(String namespaceURI,
String localName,
String qName)
The parser is at the end of an element. |
void |
log(String element,
String attribute,
String value)
|
abstract boolean |
setElementRelation(String childElement,
Object parent,
Object child)
This method sets the relations between the currently finished XML element(child) and its containing element in terms of Java objects. |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
This method defines the action to take when the parser begins to parse an element. |
void |
unSupportedNestingOfElements(String parent,
String child)
Called when certain element nesting is allowed in the XML schema but is not supported in the code as yet. |
| Methods inherited from class edu.isi.pegasus.planner.parser.Parser |
|---|
characters, getSchemaLocation, getSchemaNamespace, ignoreWhitespace, ignoreWhitespace, setDocumentLocator, setParserFeature, setSchemaLocations, startParser, testForFile |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int mDepth
protected Stack mStack
protected boolean mParsingDone
| Constructor Detail |
|---|
public StackBasedXMLParser(PegasusBag bag)
bag - the PegasusBag to be used.| Method Detail |
|---|
public abstract Object createObject(String element,
List names,
List values)
SiteData object corresponding to the element
name in the XML document.
element - the element name encountered while parsing.names - is a list of attribute names, as strings.values - is a list of attribute values, to match the key list.
IllegalArgumentException - if the element name is too short.
public abstract boolean setElementRelation(String childElement,
Object parent,
Object child)
childElement - name is the the child element nameparent - is a reference to the parent's Java objectchild - is the completed child object to connect to the parent
public void endDocument()
Parser
endDocument in interface ContentHandlerendDocument in class Parser
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerstartElement in class ParsernamespaceURI - is the URI of the namespace for the elementlocalName - is the element name without namespaceqName - is the element name as it appears in the docmentatts - has the names and values of all the attributes
SAXException
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class ParsernamespaceURI - is the URI of the namespace for the elementlocalName - is the element name without namespaceqName - is the element name as it appears in the docment
SAXException
public void log(String element,
String attribute,
String value)
element - attribute - value -
public void complain(String element,
String attribute,
String value)
element - the element nameattribute - the attribute namevalue - the attribute value
public void attributeNotSupported(String element,
String attribute,
String value)
element - the element nameattribute - the attribute namevalue - the attribute value
public void unSupportedNestingOfElements(String parent,
String child)
parent - parent elementchild - child element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||