|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xml.XMLProcessor
public class XMLProcessor
Provides an XML processor for parsing XML files.
| Field Summary | |
|---|---|
static String |
ELEMENT_CONTENT_WS_FEATURE
Feature identifier: ignoring element content whitespace feature. |
static String |
EXPAND_ENTITY_REF_FEATURE
Feature identifier: expand entity references feature. |
static String |
INCLUDE_COMMENTS_FEATURE
Feature identifier: include comments feature. |
protected org.apache.xml.resolver.tools.CatalogResolver |
m_catalogResolver
The CatalogResolver used to resolve XML entity references. |
protected DocumentBuilder |
m_db
The DocumentBuilder used to process XML Documents. |
static String |
NAMESPACE_FEATURE
Feature identifier: namespaces. |
static String |
VALIDATION_FEATURE
Feature identifier: validation feature. |
static String |
XML_FEATURE_PFX
XML Processor Feature prefix. |
| Constructor Summary | |
|---|---|
XMLProcessor()
Constructor that creates an XMLProcessor with default values. |
|
XMLProcessor(boolean validation,
boolean xmlnsAware)
Constructor that creates an XMLProcessor (a DOM parser) provided a boolean validation and xmlnsAware settings, with defaults used for other settings: ignore ignorable element content whitespace don't expand entity references |
|
XMLProcessor(Properties properties)
Constructor provided a set of Properties. |
|
| Method Summary | |
|---|---|
void |
error(SAXParseException exception)
Tunnel an existing SAXParseException. |
void |
fatalError(SAXParseException exception)
A method which handles a fatal exception given a tunneled SAXParseException. |
org.apache.xml.resolver.tools.CatalogResolver |
getCatalogResolver()
Returns the CatalogResolver used with this XMLProcessor. |
Iterator |
getErrors()
Returns an Iterator over the parse errors (as Exceptions) encountered during the last document parse, null if there were none. |
DocumentBuilder |
getParser()
Returns the DocumentBuilder (parser) used by this XMLProcessor, null if this is unavailable. |
boolean |
hadErrors()
Returns true if the previous parse contained any parsing errors. |
boolean |
isValidating()
Returns true if the DocumentBuilder (XML parser) is validating, false if a well-formed parser. |
Document |
process(InputSource source)
Returns the XML Document resulting from processing the source file, throwing an XMLParseException if a parsing error occurs. |
TypedInputSource |
resolveEntity(TypedInputSource source)
Attempts to resolve the public and system identifiers in the provided TypedInputSource source using the catalog resolver. |
protected void |
setCatalogResolver(org.apache.xml.resolver.tools.CatalogResolver resolver)
Sets the CatalogResolver used with this XMLProcessor. |
void |
warning(SAXParseException exception)
Tunnel an existing SAXParseException. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String XML_FEATURE_PFX
public static final String NAMESPACE_FEATURE
public static final String VALIDATION_FEATURE
public static final String EXPAND_ENTITY_REF_FEATURE
public static final String INCLUDE_COMMENTS_FEATURE
public static final String ELEMENT_CONTENT_WS_FEATURE
protected DocumentBuilder m_db
protected org.apache.xml.resolver.tools.CatalogResolver m_catalogResolver
| Constructor Detail |
|---|
public XMLProcessor()
throws ProcessException
ProcessException - if parser configuration errors.
public XMLProcessor(boolean validation,
boolean xmlnsAware)
throws ProcessException
validation - if true, the parser will validate.xmlnsAware - if true, the parser will be aware of XML namespaces.
ProcessException - if parser configuration errors.
public XMLProcessor(Properties properties)
throws ProcessException
Note that these features mirror those found in Xerces2.
The first time XMLProcessor is instantiated, the XML catalog resolver must be manually established with setCatalogResolver(). This is so that the PropertyManager can be created without requiring the CatalogResolver first. This can be done by first creating a WF XMLProcessor, then the validating one.
properties - processor settings
ProcessException - if parser configuration errors| Method Detail |
|---|
protected void setCatalogResolver(org.apache.xml.resolver.tools.CatalogResolver resolver)
public org.apache.xml.resolver.tools.CatalogResolver getCatalogResolver()
public TypedInputSource resolveEntity(TypedInputSource source)
public DocumentBuilder getParser()
public boolean isValidating()
public boolean hadErrors()
public Iterator getErrors()
public Document process(InputSource source)
throws XMLParseException,
ProcessException
source - a SAX InputSource to be parsed.
XMLParseException - an exception encountered during XML parsing
ProcessException - encapsulating any of the other ten thousand possible exceptionspublic void warning(SAXParseException exception)
warning in interface ErrorHandlerexception - the tunneled SAXParseException.public void error(SAXParseException exception)
error in interface ErrorHandlerexception - the tunneled SAXParseException.public void fatalError(SAXParseException exception)
fatalError in interface ErrorHandlerexception - the tunneled SAXParseException.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||