|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.speexx.xml.FeatureConfigurator
public abstract class FeatureConfigurator
Should configure a
SAXParserFactory,
XMLReader or
DocumentBuilderFactory
with defined, parser dependend features. To get a new instance, call the
newInstance() and then call init(InputStream) to set up
the configurator.
Note, that DocumentBuilderFactory did not support the
setFeature method until JAXP 1.3 (eg. Java 5).
See Xerces J Feature page for more information about features in the most used XML parser in Java.
The default implementation is thread safe.
© Copyright 2006 Sascha Kohlmann under the terms of the GNU LGPL
| Constructor Summary | |
|---|---|
FeatureConfigurator()
|
|
| Method Summary | |
|---|---|
abstract void |
configure(DocumentBuilderFactory builder)
Configures the builder factory. |
abstract void |
configure(Object featurable)
Configures all objects which has a setFeature(java.lang.String, boolean) method. |
abstract void |
configure(SAXParserFactory factory)
Configures the parser factory. |
abstract void |
configure(XMLReader reader)
Configures the reader. |
abstract void |
init(InputStream configuration)
Sets up the configurator. |
static FeatureConfigurator |
newInstance()
Returns a new instance of the configurator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FeatureConfigurator()
| Method Detail |
|---|
public static FeatureConfigurator newInstance()
public abstract void init(InputStream configuration)
throws FeatureConfigurationException
The format of the default implemantation is one namespace of the
feature, following by a space character (0x20), also fallowing by the
literal true or false pair line. The values of
the namespace maybe upper- or lower-case or mixed.
configuration - a stream to reach the configuration data.
FeatureConfigurationException - if something goes wrong.
public abstract void configure(SAXParserFactory factory)
throws ParserConfigurationException,
SAXNotRecognizedException,
SAXNotSupportedException
XMLReader.
factory - the factory to configure.
SAXNotRecognizedException - When the underlying XMLReader does not
recognize the property name.
SAXNotSupportedException - When the underlying XMLReader
recognizes the property name but
doesn't support the property.
ParserConfigurationException - if something different happens.SAXParserFactory.setFeature(java.lang.String, boolean)
public abstract void configure(XMLReader reader)
throws SAXNotRecognizedException,
SAXNotSupportedException
XMLReader.
reader - the XMLReader to configure.
SAXNotRecognizedException - When the XMLReader does not recognize
the feature name.
SAXNotSupportedException - When the XMLReader recognizes the
feature name but cannot set the
requested value.
public abstract void configure(DocumentBuilderFactory builder)
throws ParserConfigurationException
DocumentBuilderFactory.
Note: DocumentBuilderFactory supports
setFeature since JAXP 1.3 coming with
Java 5.
builder - the builder to configure.
ParserConfigurationException - if something different happens.
UnsupportedOperationException - if
DocumentBuilderFactory doesn't support
setFeature(String, boolean) cause it is
smaller JAXP 1.3.public abstract void configure(Object featurable)
setFeature(java.lang.String, boolean) method.
featurable - a class which must have at least a
setFeature method.
FeatureConfigurationException - if featurable supports
a setFeature(String, boolean) but the call
fails.
UnsupportedOperationException - if featurable doesn't
support a setFeature(String, boolean).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||