public class StdXMLParser extends java.lang.Object implements IXMLParser
Constructor and Description |
---|
StdXMLParser()
Creates a new parser.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Cleans up the object when it's destroyed.
|
IXMLBuilder |
getBuilder()
Returns the builder which creates the logical structure of the XML data.
|
IXMLReader |
getReader()
Returns the reader from which the parser retrieves its data.
|
IXMLEntityResolver |
getResolver()
Returns the entity resolver.
|
IXMLValidator |
getValidator()
Returns the validator that validates the XML data.
|
java.lang.Object |
parse()
Parses the data and lets the builder create the logical data structure.
|
protected void |
processAttribute(java.util.Vector attrNames,
java.util.Vector attrValues,
java.util.Vector attrTypes)
Processes an attribute of an element.
|
protected void |
processCDATA()
Processes a CDATA section.
|
protected void |
processDocType()
Processes a document type declaration.
|
protected void |
processElement(java.lang.String defaultNamespace,
java.util.Properties namespaces)
Processes a regular element.
|
protected void |
processPI()
Processes a "processing instruction".
|
protected void |
processSpecialTag(boolean allowCDATA)
Processes a tag that starts with a bang (<!...>).
|
protected void |
scanData()
Scans the XML data for elements.
|
protected void |
scanSomeTag(boolean allowCDATA,
java.lang.String defaultNamespace,
java.util.Properties namespaces)
Scans an XML tag.
|
void |
setBuilder(IXMLBuilder builder)
Sets the builder which creates the logical structure of the XML data.
|
void |
setReader(IXMLReader reader)
Sets the reader from which the parser retrieves its data.
|
void |
setResolver(IXMLEntityResolver resolver)
Sets the entity resolver.
|
void |
setValidator(IXMLValidator validator)
Sets the validator that validates the XML data.
|
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void setBuilder(IXMLBuilder builder)
setBuilder
in interface IXMLParser
builder
- the non-null builderpublic IXMLBuilder getBuilder()
getBuilder
in interface IXMLParser
public void setValidator(IXMLValidator validator)
setValidator
in interface IXMLParser
validator
- the non-null validatorpublic IXMLValidator getValidator()
getValidator
in interface IXMLParser
public void setResolver(IXMLEntityResolver resolver)
setResolver
in interface IXMLParser
resolver
- the non-null resolverpublic IXMLEntityResolver getResolver()
getResolver
in interface IXMLParser
public void setReader(IXMLReader reader)
setReader
in interface IXMLParser
reader
- the readerpublic IXMLReader getReader()
getReader
in interface IXMLParser
public java.lang.Object parse() throws XMLException
parse
in interface IXMLParser
XMLException
- if an error occurred reading or parsing the dataIXMLBuilder.getResult()
protected void scanData() throws java.lang.Exception
java.lang.Exception
- if something went wrongprotected void scanSomeTag(boolean allowCDATA, java.lang.String defaultNamespace, java.util.Properties namespaces) throws java.lang.Exception
allowCDATA
- true if CDATA sections are allowed at this pointdefaultNamespace
- the default namespace URI (or null)namespaces
- list of defined namespacesjava.lang.Exception
- if something went wrongprotected void processPI() throws java.lang.Exception
java.lang.Exception
- if something went wrongprotected void processSpecialTag(boolean allowCDATA) throws java.lang.Exception
allowCDATA
- true if CDATA sections are allowed at this pointjava.lang.Exception
- if something went wrongprotected void processCDATA() throws java.lang.Exception
java.lang.Exception
- if something went wrongprotected void processDocType() throws java.lang.Exception
java.lang.Exception
- if an error occurred reading or parsing the dataprotected void processElement(java.lang.String defaultNamespace, java.util.Properties namespaces) throws java.lang.Exception
defaultNamespace
- the default namespace URI (or null)namespaces
- list of defined namespacesjava.lang.Exception
- if something went wrongprotected void processAttribute(java.util.Vector attrNames, java.util.Vector attrValues, java.util.Vector attrTypes) throws java.lang.Exception
attrNames
- contains the names of the attributes.attrValues
- contains the values of the attributes.attrTypes
- contains the types of the attributes.java.lang.Exception
- if something went wrong