|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.calitha.xml.SimpleDOMParser
public class SimpleDOMParser
The SimpleDOMParser class represent an XML parser with a simplified API.
You can pass a configuration to the constructor to get the desired
features for example for validation. Take a look at the
IParserConfiguration and its implementations for the
kind of configurations you can use.
| Constructor Summary | |
|---|---|
SimpleDOMParser()
Creates a new SimpleDOMParser. |
|
SimpleDOMParser(IParserConfiguration configuration)
Creates a new SimpleDOMParser. |
|
| Method Summary | |
|---|---|
Document |
getDocument()
The DOM parsed from XML input. |
boolean |
getDynamicValidationFeature()
Determines if the dynamic validation feature is enabled. |
EntityResolver |
getEntityResolver()
Gets the custom handler for external entities. |
SimpleErrorHandler |
getErrorHandler()
Gets the error handler. |
org.apache.xerces.xni.grammars.XMLGrammarPool |
getGrammarPool()
Gets the grammar pool. |
boolean |
getNamespacesFeature()
Determines if the namespaces feature is enabled. |
String |
getNoNamespaceSchemaLocation()
Gets the override schema location for no namespace. |
String |
getSchemaLocation()
Gets the override schema location for namespaces. |
boolean |
getSchemaValidationFeature()
Determines if the schema validation feature is enabled. |
boolean |
getValidationFeature()
Determines if the validation feature is enabled. |
void |
parse(InputSource input)
Parses the XML input. |
void |
parse(InputStream input)
Parses the XML input. |
void |
setDynamicValidationFeature(boolean value)
Sets the dynamic validation feature. |
void |
setEntityResolver(EntityResolver entityResolver)
Sets the custom handler for external entities. |
void |
setGrammarPool(org.apache.xerces.xni.grammars.XMLGrammarPool pool)
Sets the grammar pool. |
void |
setNamespacesFeature(boolean value)
Sets the namespace feature. |
void |
setNoNamespaceSchemaLocation(String location)
Sets the override schema location for no namespace. |
void |
setNoNamespaceSchemaLocation(URL location)
Sets the override schema location for no namespace. |
void |
setSchemaLocation(String location)
Sets the override schema location for namespaces. |
void |
setSchemaValidationFeature(boolean value)
Sets the schema validation feature. |
void |
setValidationFeature(boolean value)
Sets the validation feature. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleDOMParser()
This parser has default settings supplied by the internal XML parser.
public SimpleDOMParser(IParserConfiguration configuration)
throws SAXNotSupportedException,
SAXNotRecognizedException
configuration - configuration
SAXNotSupportedException - if it recognizes a feature or property identifier,
but cannot perform the requested operation
SAXNotRecognizedException - if it finds an unrecognized feature or property identifier| Method Detail |
|---|
public boolean getNamespacesFeature()
IParserConfigurationpublic void setNamespacesFeature(boolean value)
value - new feature valueIParserConfigurationpublic boolean getValidationFeature()
IParserConfigurationpublic void setValidationFeature(boolean value)
value - new feature valueIParserConfigurationpublic boolean getDynamicValidationFeature()
IParserConfigurationpublic void setDynamicValidationFeature(boolean value)
value - new feature valueIParserConfigurationpublic boolean getSchemaValidationFeature()
IParserConfigurationpublic void setSchemaValidationFeature(boolean value)
value - new feature valueIParserConfigurationpublic org.apache.xerces.xni.grammars.XMLGrammarPool getGrammarPool()
The grammar pool can contain DTD's and Schema's for validation.
CachingValidatingConfiguration,
PreParsedGrammarsConfiguration,
XMLGrammarPoolBuilderpublic void setGrammarPool(org.apache.xerces.xni.grammars.XMLGrammarPool pool)
The grammar pool can contain DTD's and Schema's for validation.
pool - grammar poolCachingValidatingConfiguration,
PreParsedGrammarsConfiguration,
XMLGrammarPoolBuilderpublic String getSchemaLocation()
The location contains one or more pairs of namespace and XML Schema location. It overrides the location set in the XML file, so you can use schema's that are stored in a different location.
public void setSchemaLocation(String location)
The location contains one or more pairs of namespace and XML Schema location. It overrides the location set in the XML file, so you can use schema's that are stored in a different location.
location - schema locationSchemaLocationBuilderpublic String getNoNamespaceSchemaLocation()
The location contains one or more XML Schema location. It overrides the location set in the XML file, so you can use schema's that are stored in a different location.
public void setNoNamespaceSchemaLocation(String location)
The location contains one or more XML Schema location. It overrides the location set in the XML file, so you can use schema's that are stored in a different location.
location - schema locationpublic void setNoNamespaceSchemaLocation(URL location)
The location contains one or more XML Schema location. It overrides the location set in the XML file, so you can use schema's that are stored in a different location.
location - schema locationpublic EntityResolver getEntityResolver()
Some configurations sets a special handler.
public void setEntityResolver(EntityResolver entityResolver)
Some configurations sets a special handler.
entityResolver - entity resolver.public SimpleErrorHandler getErrorHandler()
The error handler contains warnings and errors from the last parse action.
public void parse(InputSource input)
throws IOException,
SAXException
input - XML input
IOException - if an I/O error occurs
SAXException - if a XML parse error occurs
XMLValidateException - if a validation error occurs (SAXException subclass)
public void parse(InputStream input)
throws IOException,
SAXException
input - XML input
IOException - if an I/O error occurs
SAXException - if a XML parse error occurs
XMLValidateException - if a validation error occurs (SAXException subclass)public Document getDocument()
This is available after a successful parse.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||