|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.web.parsers.BBParser
Bluebird parser for XML. BBParser provides basic XML parsing functionality to parse XML from a file or an input stream. BBParser creates a DOMParser which creates a DOM tree of the XML being parsed. BBParser provides the error handling routines for the DOM parser and provides some methods to traverse the elements of the DOM tree created as a result of the parse. The DOMParser created throws an IOException if the xml file is not found or if the xml does not conform to its DTD. In addition to this, BBParser and its sub-classes can set their own exception messages and throw exceptions if the values read are not what is expected. Sub-classes will need to override the 'processElement()' method and implement their own storage and data getter methods specific to the XML that is being processed
Nested Class Summary | |
private class |
BBParser.BBErrorHandler
Deprecated. The error handler. |
Field Summary | |
protected int |
ATTRIB_VALUE_PAIR_ERR
Deprecated. Error number set when a typical parm block does not have both the parm name and value pair as expected |
protected java.lang.String |
ATTRIB_VALUE_PAIR_ERR_STR
Deprecated. Error message set when the ATTRIB_VALUE_PAIR error occurs |
protected int |
EXCEPTION
Deprecated. Error number set by default when there is an exception |
protected java.lang.StringBuffer |
m_curElement
Deprecated. Element currently being processed - will need to be set as the sub-class goes through the DOM tree |
protected int |
m_errNum
Deprecated. The error number set when an error is encountered |
protected java.lang.String |
m_exceptionMsg
Deprecated. The error message set when an error is encountered |
protected org.xml.sax.InputSource |
m_inpSource
Deprecated. Input Stream being parsed |
protected org.apache.xerces.parsers.DOMParser |
m_parser
Deprecated. DOM parser that builds the DOM tree |
protected int |
NULL_VALUE_ERR
Deprecated. Error number set when the value read is null |
protected java.lang.String |
NULL_VALUE_ERR_STR
Deprecated. Error message set when the value read is null |
Constructor Summary | |
BBParser()
Deprecated. Default constructor - creates the DOMParser |
Method Summary | |
java.lang.String |
getErrorMessage()
Deprecated. Returns the error message for the parse |
int |
getErrorNumber()
Deprecated. Returns the error number for the parse |
void |
parse()
Deprecated. Parse the already set 'm_inpSource' |
void |
parse(org.xml.sax.InputSource inpSource)
Deprecated. Parses the input stream passed |
void |
parse(java.io.InputStream inpStream)
Deprecated. Parses the input stream passed |
void |
parse(java.lang.String fileName)
Deprecated. Parse the fileName passed |
protected boolean |
processDocument(org.w3c.dom.Document doc)
Deprecated. Process the 'Document' object or the root of the DOM tree |
protected boolean |
processElement(org.w3c.dom.Element el,
boolean isRoot)
Deprecated. Process an Element. |
protected boolean |
processNode(org.w3c.dom.Node node)
Deprecated. Processes a 'Node' object of the DOM tree depending upon the node type |
protected java.lang.String |
processParmValue(org.w3c.dom.Node parmValueNode)
Deprecated. Returns the value from a " |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final int ATTRIB_VALUE_PAIR_ERR
protected final int NULL_VALUE_ERR
protected final int EXCEPTION
protected final java.lang.String ATTRIB_VALUE_PAIR_ERR_STR
protected final java.lang.String NULL_VALUE_ERR_STR
protected java.lang.StringBuffer m_curElement
protected java.lang.String m_exceptionMsg
protected int m_errNum
protected org.apache.xerces.parsers.DOMParser m_parser
protected org.xml.sax.InputSource m_inpSource
Constructor Detail |
public BBParser()
Method Detail |
protected boolean processDocument(org.w3c.dom.Document doc)
protected boolean processNode(org.w3c.dom.Node node)
protected boolean processElement(org.w3c.dom.Element el, boolean isRoot)
protected java.lang.String processParmValue(org.w3c.dom.Node parmValueNode)
public void parse() throws java.io.IOException
java.io.IOException
- if parse fails for any reasonpublic void parse(java.lang.String fileName) throws java.io.IOException
fileName
- file to be parsed
java.io.IOException
- if parse fails for any reasonpublic void parse(java.io.InputStream inpStream) throws java.io.IOException
inpStream
- the input stream that contains the XML to be parsed
java.io.IOException
- if parse fails for any reasonpublic void parse(org.xml.sax.InputSource inpSource) throws java.io.IOException
inpSource
- the input source that contains the XML to be parsed
java.io.IOException
- if parse fails for any reasonpublic int getErrorNumber()
public java.lang.String getErrorMessage()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |