|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
oracle.xml.parser.v2.XMLParser
This class serves as a base class for the DOMParser
and SAXParser
classes. It contains methods to parse
eXtensible Markup Language (XML) 1.0 documents according to the
World Wide Web Consortium (W3C)
recommendation.
This class can not be instantiated (applications may use the DOM or
SAX parser depending on their requirements).
Field Summary |
Type | Field |
---|---|
protected java.util.Hashtable |
attributes
|
static java.lang.String |
BASE_URL
Base URL used in parsing entities. |
static java.lang.String |
DTD_OBJECT
DTD Object to be used for validation. |
static java.lang.String |
SCHEMA_OBJECT
Schema Object to be used for validation. |
static java.lang.String |
STANDALONE
Sets the standalone property of the input files. |
static java.lang.String |
USE_DTD_ONLY_FOR_VALIDATION
If true, DTD Object is used only for validation and is not added to the parser document (Boolean.TRUE or Boolean.FALSE) This property/attribute is only if setDoctype is called to use a fixed DTD. |
Method Summary |
Type | Method |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Allows the user to retrieve specific attributes on the underlying implementation. |
java.net.URL |
getBaseURL()
|
static java.lang.String |
getCompatibilityVersion()
|
EntityResolver |
getEntityResolver()
Return the current entity resolver. |
ErrorHandler |
getErrorHandler()
Return the current error handler. |
static java.lang.String |
getReleaseVersion()
Returns the release version of the Oracle XML Parser |
boolean |
getValidationMode()
Returns the validation mode |
int |
getValidationModeValue()
Returns the validation mode |
java.lang.Object |
getXMLProperty(java.lang.String name)
Get a property. |
boolean |
isXMLPropertyReadOnly(java.lang.String name)
Check is the property is read-only Returns true if the property is not supported |
boolean |
isXMLPropertySupported(java.lang.String name)
Check is the property is supported |
void |
parse(InputSource in)
Parses the XML from given input source |
void |
parse(java.io.InputStream in)
Parses the XML from given input stream. |
void |
parse(java.io.Reader r)
Parses the XML from given input stream. |
void |
parse(java.lang.String in)
Parses the XML from the URL indicated |
void |
parse(java.net.URL url)
Parses the XML document pointed to by the given URL and creates the corresponding XML document hierarchy. |
void |
reset()
Resets the parser state |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Allows the user to set specific attributes on the underlying implementation. |
void |
setBaseURL(java.net.URL url)
Set the base URL for loading external enitites and DTDs. |
void |
setDoctype(DTD dtd)
Set the DTD |
void |
setEntityResolver(EntityResolver resolver)
Allow an application to register an entity resolver. |
void |
setErrorHandler(ErrorHandler handler)
Allow an application to register an error event handler. |
void |
setLocale(java.util.Locale locale)
Applications can use this to set the locale for error reporting. |
void |
setPreserveWhitespace(boolean flag)
Set the white space preserving mode |
void |
setSchemaValidationMode(boolean flag)
Deprecated. Replaced by setValidationMode(int). |
void |
setValidationMode(boolean yes)
Deprecated. Replaced by setValidationMode(int). |
void |
setValidationMode(int valMode)
Set the validation mode This method sets the validation mode of the parser to one of the 4 types: NONVALIDATING, PARTIAL_VALIDATION, DTD_VALIDATION and SCHEMA_VALIDATION. |
java.lang.Object |
setXMLProperty(java.lang.String name,
java.lang.Object value)
Set a property. |
void |
setXMLSchema(java.lang.Object schema)
Set an XMLSchema for validating the instance document |
Field Detail |
public static final java.lang.String DTD_OBJECT
public static final java.lang.String USE_DTD_ONLY_FOR_VALIDATION
public static final java.lang.String SCHEMA_OBJECT
public static final java.lang.String BASE_URL
public static final java.lang.String STANDALONE
protected java.util.Hashtable attributes
Method Detail |
public void reset()
public void parse(InputSource in) throws XMLParseException, SAXException, java.io.IOException
in
- the org.xml.sax.InputSouce
to parsepublic void parse(java.lang.String in) throws XMLParseException, SAXException, java.io.IOException
in
- the String
containing the URL to parse frompublic final void parse(java.net.URL url) throws XMLParseException, SAXException, java.io.IOException
url
- the url points to the XML document to parse.public final void parse(java.io.InputStream in) throws XMLParseException, SAXException, java.io.IOException
in
- the InputStream
containing XML data to parse.setBaseURL(java.net.URL)
public final void parse(java.io.Reader r) throws XMLParseException, SAXException, java.io.IOException
r
- the Reader
containing XML data to parse.setBaseURL(java.net.URL)
public void setEntityResolver(EntityResolver resolver)
If the application does not register an entity resolver, the XMLReader will perform its own default resolution.
Applications may register a new or different resolver in the middle of a parse, and the SAX parser must begin using the new resolver immediately.
resolver
- The entity resolver.getEntityResolver()
public EntityResolver getEntityResolver()
setEntityResolver(org.xml.sax.EntityResolver)
public void setErrorHandler(ErrorHandler handler)
If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
handler
- The error handler.getErrorHandler()
public ErrorHandler getErrorHandler()
setErrorHandler(org.xml.sax.ErrorHandler)
public void setLocale(java.util.Locale locale) throws SAXException
locale
- Locale
to setSAXException
could be thrown.Parser.setLocale(java.util.Locale)
public void setDoctype(DTD dtd)
dtd
- DTD
to set and used while parsingpublic void setSchemaValidationMode(boolean flag)
flag
- determines whether the XML parser
should invoke schema validatingpublic void setValidationMode(boolean yes)
yes
- determines whether the XML parser should be validatingpublic void setValidationMode(int valMode)
valMode
- determines the type of the validation mode which the
parser is set topublic void setBaseURL(java.net.URL url)
url
- The base URLpublic java.net.URL getBaseURL()
public void setPreserveWhitespace(boolean flag)
flag
- preserving modepublic boolean getValidationMode()
true
if the XML parser is validating
false
if notpublic int getValidationModeValue()
0
if the XML parser is NONVALIDATING
1
if the XML parser is PARTIAL_VALIDATION
2
if the XML parser is DTD_VALIDATION
3
if the XML parser is SCHEMA_VALIDATIONpublic static java.lang.String getReleaseVersion()
public void setXMLSchema(java.lang.Object schema)
schema
- The XMLSchema objectpublic void setAttribute(java.lang.String name, java.lang.Object value) throws java.lang.IllegalArgumentException
name
- The name of the attribute.value
- The value of the attribute.public java.lang.Object getAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
name
- The name of the attribute.public java.lang.Object setXMLProperty(java.lang.String name, java.lang.Object value)
name
- - name of the propertyvalue
- - value of the propertypublic java.lang.Object getXMLProperty(java.lang.String name)
name
- - name of the propertypublic boolean isXMLPropertySupported(java.lang.String name)
name
- - name of the propertypublic boolean isXMLPropertyReadOnly(java.lang.String name)
name
- - name of the propertypublic static java.lang.String getCompatibilityVersion()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |