Package com.nt.udc.io.xml
Class CXMLParser
java.lang.Object
com.nt.udc.io.xml.CXMLParser
This class is used to parse XML input, obtained from a data-source.
Every time a root-element (@see CXMLElement) is encountered, the parser-processor is called upon to process the element. Any errors are reported.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CXMLElementXML Element currently being processedprotected static intprotected CXMLElement[]Stack of XML Elements.protected intThis is the index in the stack of elements.protected IDataSourceThis member represents the data source for the XML stream.protected ILoggerObject implementing ILogger interface - used for logging errors, warnings, etc.protected IXMLParserProcessorReference to the object called upon to process root-elements.protected CXMLScannerThis member represents the lexical analyzer -
Constructor Summary
ConstructorsConstructorDescriptionCXMLParser(IDataSource iDataSource) CXMLParser(IDataSource iDataSource, ILogger iLogger) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidfinal intstatic final intfinal booleanprotected booleanThis function is used to initialize the scanner.final IXMLParserProcessorbooleanparse()This function is used to parse XML input obtained from the data-source.static voidsetDebugLevel(int debugLevel) voidsetIParserProcessor(IXMLParserProcessor iParserProcessor)
-
Field Details
-
m_debugLevel
protected static int m_debugLevel -
m_iLogger
Object implementing ILogger interface - used for logging errors, warnings, etc. -
m_iParserProcessor
Reference to the object called upon to process root-elements. -
m_iDataSource
This member represents the data source for the XML stream. -
m_scanner
This member represents the lexical analyzer -
m_crtElement
XML Element currently being processed -
m_elementStack
Stack of XML Elements. Contains the elements currently being defined -
m_elementStkIndex
protected int m_elementStkIndexThis is the index in the stack of elements.
-
-
Constructor Details
-
Method Details
-
getDebugLevel
public static final int getDebugLevel() -
iParserProcessor
-
getCurrentLine
public final int getCurrentLine() -
hasEmptyStack
public final boolean hasEmptyStack() -
setDebugLevel
public static void setDebugLevel(int debugLevel) -
setIParserProcessor
-
parse
public boolean parse()This function is used to parse XML input obtained from the data-source.- Returns:
- true if successful, false otherwise.
-
initScanner
protected boolean initScanner()This function is used to initialize the scanner.- Returns:
- true if successful, false otherwise
-
error
-
debug
-