Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.xml.transform.TransformerFactory
public abstract class TransformerFactory
extends java.lang.Object
Constructor Summary | |
Method Summary | |
Source |
|
Object |
|
ErrorListener |
|
boolean |
|
URIResolver |
|
static TransformerFactory |
|
Templates |
|
Transformer |
|
Transformer |
|
void |
|
void |
|
void |
|
void |
|
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException
Returns a source object representing the XML resource specified by the xml-stylesheet processing instruction and matching the given criteria. Note that if multiple stylesheets are selected, the source represents a stylesheet composed of a list of imports.
- Parameters:
source
- the source XML documentmedia
- the media attribute to match, ornull
to match the preferred templatestitle
- the title attribute to match, ornull
to match anycharset
- the charset attribute to match, ornull
to match any
public Object getAttribute(String name) throws IllegalArgumentException
Retrieve the specified named attribute value.
- Parameters:
name
- the attribute name
public ErrorListener getErrorListener()
Returns the callback to be used by transformers obtained from this factory to report transformation errors.
public boolean getFeature(String name)
Returns the state of a feature in the factory implementation. Feature names are fully qualified URIs, and may depend on the factory implementation. JAXP also predefines several features, including the constants inXMLConstants
and The latter expose various capabilities of the factory implementation.
public URIResolver getURIResolver()
Returns the resolver callback to be used by transformers obtained from this factory.
public static TransformerFactory newInstance() throws TransformerFactoryConfigurationError
Creates a new factory instance. The implementation class to load is the first found in the following locations:
- the
javax.xml.transform.TransformerFactory
system property- the above named property value in the
$JAVA_HOME/lib/jaxp.properties
file- the class name specified in the
META-INF/services/javax.xml.parsers.DocumentBuilderFactory
system resource- the default factory class
public Templates newTemplates(Source source) throws TransformerConfigurationException
Creates a new compiled transformation using the specified stylesheet.
- Parameters:
source
- the source of an XSLT stylesheet specifying the transformation to apply
public Transformer newTransformer() throws TransformerConfigurationException
Creates a new transformer that applies the identity transform.
public Transformer newTransformer(Source source) throws TransformerConfigurationException
Creates a new transformer using the specified stylesheet.
- Parameters:
source
- the source of an XSLT stylesheet specifying the transformation to apply
public void setAttribute(String name, Object value) throws IllegalArgumentException
Set a named attribute on the underlying implementation.
- Parameters:
name
- the attribute namevalue
- the value to assign
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
Sets the callback to be used by transformers obtained from this factory to report transformation errors.
public void setFeature(String name, boolean value) throws TransformerConfigurationException
Sets a feature of transformers and templates obtained from this factory. Feature names are fully qualified URIs, and may depend on the factory implementation.
- Parameters:
name
- the name of the featurevalue
- the feature state
- Throws:
TransformerConfigurationException
- if the feature is unsupported
public void setURIResolver(URIResolver resolver)
Set the resolver callback to be used by transformers obtained from this factory.