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 java.lang.String |
mChild
The current child.
|
private int |
mCurrentDepth
The current depth of parsing through the xml structure.
|
private java.util.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 java.lang.String |
SCHEMA_LOCATION
The "not-so-official" location URL of the DAX schema definition.
|
static java.lang.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(java.lang.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(java.lang.String uri,
java.lang.String local,
java.lang.String qName)
An empty implementation is provided by DefaultHandler class.
|
java.lang.String |
getSchemaLocation()
Helps the load database to locate the PDAX XML schema, if available.
|
java.lang.String |
getSchemaNamespace()
Returns the XML schema namespace that a document being parsed conforms
to.
|
private void |
invalidAttribute(java.lang.String element,
java.lang.String key,
java.lang.String value)
Logs a message if an unknown key is come across, while parsing the
xml document.
|
private void |
invalidValue(java.lang.String element,
java.lang.String key,
java.lang.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(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
An empty implementation is provided by DefaultHandler of ContentHandler.
|
void |
startParser(java.lang.String file)
Ends up starting the parsing of the file , by the underlying parser.
|
characters, ignoreWhitespace, ignoreWhitespace, setDocumentLocator, setParserFeature, setSchemaLocations, testForFilepublic static final java.lang.String SCHEMA_LOCATION
public static final java.lang.String SCHEMA_NAMESPACE
private Partition mPartition
private int mCurrentDepth
private java.lang.String mChild
private java.util.List mParents
private Callback mCallback
public PDAXParser(PegasusProperties properties)
properties - the PegasusProperties to be used.public PDAXParser(java.lang.String fileName,
PegasusProperties properties)
fileName - the file which one has to parse using the parser.properties - the PegasusProperties to be used.public java.lang.String getSchemaNamespace()
getSchemaNamespace in class Parserpublic void setCallback(Callback callback)
public void startParser(java.lang.String file)
startParser in class Parserfile - the path/url to the file that needs to be parsed.public void startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class Parserorg.xml.sax.SAXExceptionpublic void endElement(java.lang.String uri,
java.lang.String local,
java.lang.String qName)
endElement in interface org.xml.sax.ContentHandlerendElement in class Parserpublic void endDocument()
endDocument in interface org.xml.sax.ContentHandlerendDocument in class Parserpublic java.lang.String getSchemaLocation()
getSchemaLocation in class Parserprivate void invalidAttribute(java.lang.String element,
java.lang.String key,
java.lang.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(java.lang.String element,
java.lang.String key,
java.lang.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.