com.ibm.portal.resolver.xml
Interface XMLPropertyProvider


public interface XMLPropertyProvider

Since:
6.1.0

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

getFeature

boolean getFeature(java.lang.String name)
                   throws org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
Look up the value of a feature flag.

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.

Parameters:
name - The feature name, which is a fully-qualified URI.
Returns:
The current value of the feature (true or false).
Throws:
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.
See Also:
setFeature(java.lang.String, boolean)

getProperty

java.lang.Object getProperty(java.lang.String name)
                             throws org.xml.sax.SAXNotRecognizedException,
                                    org.xml.sax.SAXNotSupportedException
Look up the value of a property.

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.

Parameters:
name - The property name, which is a fully-qualified URI.
Returns:
The current value of the property.
Throws:
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.
See Also:
setProperty(java.lang.String, java.lang.Object)

setFeature

void setFeature(java.lang.String name,
                boolean value)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
Set the value of a feature flag.

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.

Parameters:
name - The feature name, which is a fully-qualified URI.
value - The requested value of the feature (true or false).
Throws:
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.
See Also:
getFeature(java.lang.String)

setProperty

void setProperty(java.lang.String name,
                 java.lang.Object value)
                 throws org.xml.sax.SAXNotRecognizedException,
                        org.xml.sax.SAXNotSupportedException
Set the value of a property.

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.

Parameters:
name - The property name, which is a fully-qualified URI.
value - The requested value for the property.
Throws:
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.