public abstract class TransformerFactory extends Object
Modifier | Constructor and Description |
---|---|
protected |
TransformerFactory() |
Modifier and Type | Method and Description |
---|---|
abstract Source |
getAssociatedStylesheet(Source source,
String media,
String title,
String charset)
Returns a source object representing the XML resource specified by the
xml-stylesheet
processing instruction and matching the given criteria.
|
abstract Object |
getAttribute(String name)
Retrieve the specified named attribute value.
|
abstract ErrorListener |
getErrorListener()
Returns the callback to be used by transformers obtained from this
factory to report transformation errors.
|
abstract boolean |
getFeature(String name)
Returns the state of a feature in the factory implementation.
|
abstract URIResolver |
getURIResolver()
Returns the resolver callback to be used by transformers obtained from
this factory.
|
static TransformerFactory |
newInstance()
Creates a new factory instance.
|
abstract Templates |
newTemplates(Source source)
Creates a new compiled transformation using the specified stylesheet.
|
abstract Transformer |
newTransformer()
Creates a new transformer that applies the identity transform.
|
abstract Transformer |
newTransformer(Source source)
Creates a new transformer using the specified stylesheet.
|
abstract void |
setAttribute(String name,
Object value)
Set a named attribute on the underlying implementation.
|
abstract void |
setErrorListener(ErrorListener listener)
Sets the callback to be used by transformers obtained from this factory
to report transformation errors.
|
abstract void |
setFeature(String name,
boolean value)
Sets a feature of transformers and templates obtained from this
factory.
|
abstract void |
setURIResolver(URIResolver resolver)
Set the resolver callback to be used by transformers obtained from
this factory.
|
protected TransformerFactory()
public static TransformerFactory newInstance() throws TransformerFactoryConfigurationError
javax.xml.transform.TransformerFactory
system
property$JAVA_HOME/lib/jaxp.properties
fileMETA-INF/services/javax.xml.parsers.DocumentBuilderFactory
system resourcepublic abstract Transformer newTransformer(Source source) throws TransformerConfigurationException
source
- the source of an XSLT
stylesheet specifying the transformation to applyTransformerConfigurationException
public abstract Transformer newTransformer() throws TransformerConfigurationException
public abstract Templates newTemplates(Source source) throws TransformerConfigurationException
source
- the source of an XSLT
stylesheet specifying the transformation to applyTransformerConfigurationException
public abstract Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException
source
- the source XML documentmedia
- the media attribute to match, or null
to match
the preferred templatestitle
- the title attribute to match, or null
to match
anycharset
- the charset attribute to match, or null
to
match anyTransformerConfigurationException
public abstract void setURIResolver(URIResolver resolver)
public abstract URIResolver getURIResolver()
public abstract void setFeature(String name, boolean value) throws TransformerConfigurationException
name
- the name of the featurevalue
- the feature stateTransformerConfigurationException
- if the feature is
unsupportedpublic abstract boolean getFeature(String name)
XMLConstants
and
The latter expose various capabilities of the factory implementation.public abstract void setAttribute(String name, Object value) throws IllegalArgumentException
name
- the attribute namevalue
- the value to assignIllegalArgumentException
- if the attribute is not supportedpublic abstract Object getAttribute(String name) throws IllegalArgumentException
name
- the attribute nameIllegalArgumentException
- if the attribute is not supportedpublic abstract void setErrorListener(ErrorListener listener) throws IllegalArgumentException
IllegalArgumentException
public abstract ErrorListener getErrorListener()