edu.isi.pegasus.planner.parser
public class PDAXParser extends Parser
Modifier and Type | Field and Description |
---|---|
private Callback |
mCallback
The callback handler to which the callbacks are sent during designated
points of parsing the pdax.
|
private String |
mChild
The current child.
|
private int |
mCurrentDepth
The current depth of parsing through the xml structure.
|
private List |
mParents
List of parents for a particular child.
|
private Partition |
mPartition
The object holding the contents of one partition as indicated in the
pdax.
|
static String |
SCHEMA_LOCATION
The "not-so-official" location URL of the DAX schema definition.
|
static String |
SCHEMA_NAMESPACE
URI namespace
|
DEFAULT_PARSER_NAME, mAdjFName, mLocator, mLogger, mLogMsg, mParser, mProps, mTextContent, mTextString
Constructor and Description |
---|
PDAXParser(PegasusProperties properties)
The default constructor.
|
PDAXParser(String fileName,
PegasusProperties properties)
The constructor initialises the parser, and turns on the validation feature
in Xerces.
|
Modifier and Type | Method and Description |
---|---|
void |
endDocument()
This is called automatically when the end of the XML file is reached.
|
void |
endElement(String uri,
String local,
String qName)
An empty implementation is provided by DefaultHandler class.
|
String |
getSchemaLocation()
Helps the load database to locate the PDAX XML schema, if available.
|
String |
getSchemaNamespace()
Returns the XML schema namespace that a document being parsed conforms
to.
|
private void |
invalidAttribute(String element,
String key,
String value)
Logs a message if an unknown key is come across, while parsing the
xml document.
|
private void |
invalidValue(String element,
String key,
String value)
Logs a message if an unknown value is come across, while parsing the
xml document.
|
void |
setCallback(Callback callback)
Sets the callback handler for this parsing instance.
|
void |
startElement(String uri,
String local,
String raw,
Attributes attrs)
An empty implementation is provided by DefaultHandler of ContentHandler.
|
void |
startParser(String file)
Ends up starting the parsing of the file , by the underlying parser.
|
characters, ignoreWhitespace, ignoreWhitespace, setDocumentLocator, setParserFeature, setSchemaLocations, testForFile
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
public static final String SCHEMA_LOCATION
public static final String SCHEMA_NAMESPACE
private Partition mPartition
private int mCurrentDepth
private String mChild
private List mParents
private Callback mCallback
public PDAXParser(PegasusProperties properties)
properties
- the PegasusProperties
to be used.public PDAXParser(String fileName, PegasusProperties properties)
fileName
- the file which one has to parse using the parser.properties
- the PegasusProperties
to be used.public String getSchemaNamespace()
getSchemaNamespace
in class Parser
public void setCallback(Callback callback)
public void startParser(String file)
startParser
in class Parser
file
- the path/url to the file that needs to be parsed.public void startElement(String uri, String local, String raw, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
startElement
in class Parser
SAXException
public void endElement(String uri, String local, String qName)
endElement
in interface ContentHandler
endElement
in class Parser
public void endDocument()
endDocument
in interface ContentHandler
endDocument
in class Parser
public String getSchemaLocation()
getSchemaLocation
in class Parser
private void invalidAttribute(String element, String key, String value)
element
- the xml element in which the invalid key was come across.key
- the key that is construed to be invalid.value
- the value associated with the key.private void invalidValue(String element, String key, String value)
element
- the xml element in which the invalid key was come across.key
- the key that is construed to be invalid.value
- the value associated with the key.