A TransformerFactory instance can be used to create
javax. and
javax. objects.
The system property that determines which Factory implementation
to create is named "javax.xml.transform.TransformerFactory".
This property names a concrete subclass of the
TransformerFactory abstract class. If the property is not
defined, a platform default is be used.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Source | Returns: ASource Object suitable for passing
to the TransformerFactory.The XML source document. source, String The media attribute to be matched. May be null, in which
case the preferred templates will be used (i.e. alternate = no). media, String The value of the title attribute to match. May be null. title, String The value of the charset attribute to match. May be null. charset)Get the stylesheet specification(s) associated with the
XML |
| public abstract Object | Returns: value The value of the attribute.The name of the attribute. name)Allows the user to retrieve specific attributes on the underlying implementation. |
| public abstract ErrorListener | Returns: The current error handler, which should never be null.Get the error event handler for the TransformerFactory. |
| public abstract boolean | Returns: The current state of the feature,true or false.Feature name. name)Look up the value of a feature. |
| public abstract URIResolver | Returns: The URIResolver that was set with setURIResolver.Get the object that is used by default during the transformation to resolve URIs used in document(), xsl:import, or xsl:include. |
| public static TransformerFactory | Returns: A new instance of theTransformerFactory builtin
system-default implementation.Creates a new instance of the |
| public static TransformerFactory | Returns: new TransformerFactory instance, never null.Obtains a new instance of a |
| public static TransformerFactory | Returns: new TransformerFactory instance, never null.fully qualified factory class name that provides implementation of factoryClassName, ClassLoader javax.xml.transform.TransformerFactory.ClassLoader used to load the factory class. If null
current Thread's context classLoader is used to load the factory class.Obtain a new instance of a |
| public abstract Templates | Returns: A Templates object capable of being used for transformation purposes, nevernull.An object that holds a URL, input stream, etc. source)Process the Source into a Templates object, which is a a compiled representation of the source. |
| public abstract Transformer | Returns: ATransformer object that may be used to perform
a transformation in a single Thread, never
null.Source of XSLT document used to create
Transformer.
Examples of XML Sources include
DOMSource,
SAXSource, and
StreamSource.Process the |
| public abstract Transformer | Returns: A Transformer object that may be used to perform a transformation in a single thread, never null.Create a new |
| public abstract void | setAttribute(String
The name of the attribute. name, Object The value of the attribute. value)Allows the user to set specific attributes on the underlying implementation. |
| public abstract void | setErrorListener(ErrorListener
The new error listener. listener)Set the error event listener for the TransformerFactory, which is used for the processing of transformation instructions, and not for the transformation itself. |
| public abstract void | setFeature(String
Feature name. name, boolean Is feature state value)true or false.Set a feature for this |
| public abstract void | setURIResolver(URIResolver
An object that implements the URIResolver interface,
or null. resolver)Set an object that is used by default during the transformation to resolve URIs used in document(), xsl:import, or xsl:include. |
| TransformerFactory | back to summary |
|---|---|
| protected TransformerFactory() Default constructor is protected on purpose. | |
| getAssociatedStylesheet | back to summary |
|---|---|
| public abstract Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException Get the stylesheet specification(s) associated with the
XML
| |
| getAttribute | back to summary |
|---|---|
| public abstract Object getAttribute(String name) Allows the user to retrieve specific attributes on the underlying
implementation.
An
| |
| getErrorListener | back to summary |
|---|---|
| public abstract ErrorListener getErrorListener() Get the error event handler for the TransformerFactory.
| |
| getFeature | back to summary |
|---|---|
| public abstract boolean getFeature(String name) Look up the value of a feature.
Feature names are fully qualified
| |
| getURIResolver | back to summary |
|---|---|
| public abstract URIResolver getURIResolver() Get the object that is used by default during the transformation to resolve URIs used in document(), xsl:import, or xsl:include.
| |
| newDefaultInstance | back to summary |
|---|---|
| public static TransformerFactory newDefaultInstance() Creates a new instance of the
| |
| newInstance | back to summary |
|---|---|
| public static TransformerFactory newInstance() throws TransformerFactoryConfigurationError Obtains a new instance of a
Once an application has obtained a reference to a
| |
| newInstance | back to summary |
|---|---|
| public static TransformerFactory newInstance(String factoryClassName, ClassLoader classLoader) throws TransformerFactoryConfigurationError Obtain a new instance of a Once an application has obtained a reference to a
Tip for Trouble-shootingSetting the If you have problems try: java -Djaxp.debug=1 YourProgram ....
| |
| newTemplates | back to summary |
|---|---|
| public abstract Templates newTemplates(Source source) throws TransformerConfigurationException Process the Source into a Templates object, which is a a compiled representation of the source. This Templates object may then be used concurrently across multiple threads. Creating a Templates object allows the TransformerFactory to do detailed performance optimization of transformation instructions, without penalizing runtime transformation.
| |
| newTransformer | back to summary |
|---|---|
| public abstract Transformer newTransformer(Source source) throws TransformerConfigurationException Process the
| |
| newTransformer | back to summary |
|---|---|
| public abstract Transformer newTransformer() throws TransformerConfigurationException Create a new
| |
| setAttribute | back to summary |
|---|---|
| public abstract void setAttribute(String name, Object value) Allows the user to set specific attributes on the underlying
implementation. An attribute in this context is defined to
be an option that the implementation provides.
An
All implementations that implement JAXP 1.5 or newer are required to
support the
| |
| setErrorListener | back to summary |
|---|---|
| public abstract void setErrorListener(ErrorListener listener) Set the error event listener for the TransformerFactory, which
is used for the processing of transformation instructions,
and not for the transformation itself.
An
| |
| setFeature | back to summary |
|---|---|
| public abstract void setFeature(String name, boolean value) throws TransformerConfigurationException Set a feature for this
Feature names are fully qualified All implementations are required to support the
| |
| setURIResolver | back to summary |
|---|---|
| public abstract void setURIResolver(URIResolver resolver) Set an object that is used by default during the transformation to resolve URIs used in document(), xsl:import, or xsl:include.
| |