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 CXMLElement
XML Element currently being processedprotected static int
protected CXMLElement[]
Stack of XML Elements.protected int
This is the index in the stack of elements.protected IDataSource
This member represents the data source for the XML stream.protected ILogger
Object implementing ILogger interface - used for logging errors, warnings, etc.protected IXMLParserProcessor
Reference to the object called upon to process root-elements.protected CXMLScanner
This member represents the lexical analyzer -
Constructor Summary
ConstructorsConstructorDescriptionCXMLParser
(IDataSource iDataSource) CXMLParser
(IDataSource iDataSource, ILogger iLogger) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
final int
static final int
final boolean
protected boolean
This function is used to initialize the scanner.final IXMLParserProcessor
boolean
parse()
This function is used to parse XML input obtained from the data-source.static void
setDebugLevel
(int debugLevel) void
setIParserProcessor
(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
-