|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XMLPropertyProvider
Method Summary | |
---|---|
boolean |
getFeature(java.lang.String name)
Look up the value of a feature flag. |
java.lang.Object |
getProperty(java.lang.String name)
Look up the value of a property. |
void |
setFeature(java.lang.String name,
boolean value)
Set the value of a feature flag. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set the value of a property. |
Method Detail |
---|
boolean getFeature(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
The feature name is any fully-qualified URI. It is possible for an XMLReader to recognize a feature name but temporarily be unable to return its value. Some feature values may be available only in specific contexts, such as before, during, or after a parse. Also, some feature values may not be programmatically accessible.
All XMLReaders are required to recognize the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes feature names.
Typical usage is something like this:
XMLReader r = new MySAXDriver(); // try to activate validation try { r.setFeature("http://xml.org/sax/features/validation", true); } catch (SAXException e) { System.err.println("Cannot activate validation."); } // register event handlers r.setContentHandler(new MyContentHandler()); r.setErrorHandler(new MyErrorHandler()); // parse the first document try { r.parse("http://www.foo.com/mydoc.xml"); } catch (IOException e) { System.err.println("I/O exception reading XML document"); } catch (SAXException e) { System.err.println("XML exception reading document."); }
Implementors are free (and encouraged) to invent their own features, using names built on their own URIs.
name
- The feature name, which is a fully-qualified URI.
org.xml.sax.SAXNotRecognizedException
- If the feature value can't be assigned or retrieved.
org.xml.sax.SAXNotSupportedException
- When the XMLReader recognizes the feature name but cannot
determine its value at this time.setFeature(java.lang.String, boolean)
java.lang.Object getProperty(java.lang.String name) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
The property name is any fully-qualified URI. It is possible for an XMLReader to recognize a property name but temporarily be unable to return its value. Some property values may be available only in specific contexts, such as before, during, or after a parse.
XMLReaders are not required to recognize any specific property names, though an initial core set is documented for SAX2.
Implementors are free (and encouraged) to invent their own properties, using names built on their own URIs.
name
- The property name, which is a fully-qualified URI.
org.xml.sax.SAXNotRecognizedException
- If the property value can't be assigned or retrieved.
org.xml.sax.SAXNotSupportedException
- When the XMLReader recognizes the property name but cannot
determine its value at this time.setProperty(java.lang.String, java.lang.Object)
void setFeature(java.lang.String name, boolean value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
The feature name is any fully-qualified URI. It is possible for an XMLReader to expose a feature value but to be unable to change the current value. Some feature values may be immutable or mutable only in specific contexts, such as before, during, or after a parse.
All XMLReaders are required to support setting http://xml.org/sax/features/namespaces to true and http://xml.org/sax/features/namespace-prefixes to false.
name
- The feature name, which is a fully-qualified URI.value
- The requested value of the feature (true or false).
org.xml.sax.SAXNotRecognizedException
- If the feature value can't be assigned or retrieved.
org.xml.sax.SAXNotSupportedException
- When the XMLReader recognizes the feature name but cannot
set the requested value.getFeature(java.lang.String)
void setProperty(java.lang.String name, java.lang.Object value) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
The property name is any fully-qualified URI. It is possible for an XMLReader to recognize a property name but to be unable to change the current value. Some property values may be immutable or mutable only in specific contexts, such as before, during, or after a parse.
XMLReaders are not required to recognize setting any specific property names, though a core set is defined by SAX2.
This method is also the standard mechanism for setting extended handlers.
name
- The property name, which is a fully-qualified URI.value
- The requested value for the property.
org.xml.sax.SAXNotRecognizedException
- If the property value can't be assigned or retrieved.
org.xml.sax.SAXNotSupportedException
- When the XMLReader recognizes the property name but cannot
set the requested value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |