| java.lang.Object javax.xml.transform.TransformerFactory javax.xml.transform.sax.SAXTransformerFactory net.sf.saxon.TransformerFactoryImpl
TransformerFactoryImpl | public class TransformerFactoryImpl extends SAXTransformerFactory (Code) | | A TransformerFactoryImpl instance can be used to create Transformer and Template
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.
This implementation class implements the abstract methods on both the
javax.xml.transform.TransformerFactory and javax.xml.transform.sax.SAXTransformerFactory
classes.
|
Method Summary | |
public Source | getAssociatedStylesheet(Source source, String media, String title, String charset) Get the stylesheet specification(s) associated
via the xml-stylesheet processing instruction (see
http://www.w3.org/TR/xml-stylesheet/) with the document
document specified in the source parameter, and that match
the given criteria. | public Object | getAttribute(String name) Allows the user to retrieve specific attributes on the underlying
implementation.
Parameters: name - The name of the attribute. | public Configuration | getConfiguration() | public ErrorListener | getErrorListener() Get the error event handler for the TransformerFactory. | public boolean | getFeature(String name) Look up the value of a feature.
The feature name is any absolute URI.
Parameters: name - The feature name, which is an absolute URI. | public URIResolver | getURIResolver() Get the object that is used by default during the transformation
to resolve URIs used in document(), xsl:import, or xsl:include. | public Templates | newTemplates(Source source) Process the Source into a Templates object, which is a
a compiled representation of the source. | public TemplatesHandler | newTemplatesHandler() Get a TemplatesHandler object that can process SAX
ContentHandler events into a Templates object. | public Transformer | newTransformer(Source source) Process the Source into a Transformer object. | public Transformer | newTransformer() Create a new Transformer object that performs a copy
of the source to the result. | public TransformerHandler | newTransformerHandler(Source src) Get a TransformerHandler object that can process SAX
ContentHandler events into a Result, based on the transformation
instructions specified by the argument.
Parameters: src - The Source of the transformation instructions. | public TransformerHandler | newTransformerHandler(Templates templates) Get a TransformerHandler object that can process SAX
ContentHandler events into a Result, based on the Templates argument.
Parameters: templates - The compiled transformation instructions. | public TransformerHandler | newTransformerHandler() Get a TransformerHandler object that can process SAX
ContentHandler events into a Result. | public XMLFilter | newXMLFilter(Source src) Create an XMLFilter that uses the given Source as the
transformation instructions.
Parameters: src - The Source of the transformation instructions. | public XMLFilter | newXMLFilter(Templates templates) Create an XMLFilter, based on the Templates argument..
Parameters: templates - The compiled transformation instructions. | public void | setAttribute(String name, Object value) Allows the user to set specific attributes on the underlying
implementation. | public void | setConfiguration(Configuration config) | public 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. | public void | setFeature(String name, boolean value) Set a feature for this TransformerFactory and Transformer s
or Template s created by this factory.
Feature names are fully qualified
java.net.URI s.
Implementations may define their own features.
An
javax.xml.transform.TransformerConfigurationException is thrown if this TransformerFactory or the
Transformer s or Template s it creates cannot support the feature.
It is possible for an TransformerFactory to expose a feature value but be unable to change its state.
All implementations are required to support the FEATURE_SECURE_PROCESSING feature.
When the feature is:
| public void | setURIResolver(URIResolver resolver) Set an object that is used by default during the transformation
to resolve URIs used in xsl:import, or xsl:include. |
TransformerFactoryImpl | public TransformerFactoryImpl()(Code) | | Default constructor.
|
TransformerFactoryImpl | public TransformerFactoryImpl(Configuration config)(Code) | | Construct a TransformerFactory using an existing Configuration.
|
getAssociatedStylesheet | public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException(Code) | | Get the stylesheet specification(s) associated
via the xml-stylesheet processing instruction (see
http://www.w3.org/TR/xml-stylesheet/) with the document
document specified in the source parameter, and that match
the given criteria. Note that it is possible to return several
stylesheets, in which case they are applied as if they were
a list of imports or cascades.
Parameters: source - The XML source document. Parameters: media - The media attribute to be matched. May be null, in whichcase the prefered templates will be used (i.e. alternate = no). Parameters: title - The value of the title attribute to match. May be null. Parameters: charset - The value of the charset attribute to match. May be null. A Source object suitable for passing to the TransformerFactory. throws: TransformerConfigurationException - if any problems occur |
getAttribute | public Object getAttribute(String name) throws IllegalArgumentException(Code) | | Allows the user to retrieve specific attributes on the underlying
implementation.
Parameters: name - The name of the attribute. value The value of the attribute. throws: IllegalArgumentException - thrown if the underlyingimplementation doesn't recognize the attribute. |
getErrorListener | public ErrorListener getErrorListener()(Code) | | Get the error event handler for the TransformerFactory.
The current error listener, which should never be null. |
getFeature | public boolean getFeature(String name)(Code) | | Look up the value of a feature.
The feature name is any absolute URI.
Parameters: name - The feature name, which is an absolute URI. The current state of the feature (true or false). |
getURIResolver | public URIResolver getURIResolver()(Code) | | Get the object that is used by default during the transformation
to resolve URIs used in document(), xsl:import, or xsl:include.
The URIResolver that was set with setURIResolver. |
newTemplates | public Templates newTemplates(Source source) throws TransformerConfigurationException(Code) | | 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.
Parameters: source - An object that holds a URL, input stream, etc. A Templates object capable of being used for transformation purposes,never null. exception: TransformerConfigurationException - May throw this during the parse when itis constructing the Templates object and fails. |
newTransformer | public Transformer newTransformer(Source source) throws TransformerConfigurationException(Code) | | Process the Source into a Transformer object. Care must
be given not to use this object in multiple threads running concurrently.
Different TransformerFactories can be used concurrently by different
threads.
Parameters: source - An object that holds a URI, input stream, etc. A Transformer object that may be used to perform a transformationin a single thread, never null. exception: TransformerConfigurationException - May throw this during the parsewhen it is constructing the Templates object and fails. |
newTransformerHandler | public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException(Code) | | Get a TransformerHandler object that can process SAX
ContentHandler events into a Result, based on the transformation
instructions specified by the argument.
Parameters: src - The Source of the transformation instructions. TransformerHandler ready to transform SAX events. throws: TransformerConfigurationException - If for some reason theTransformerHandler can not be created. |
newTransformerHandler | public TransformerHandler newTransformerHandler() throws TransformerConfigurationException(Code) | | Get a TransformerHandler object that can process SAX
ContentHandler events into a Result. The transformation
is defined as an identity (or copy) transformation, for example
to copy a series of SAX parse events into a DOM tree.
A non-null reference to a TransformerHandler, that maybe used as a ContentHandler for SAX parse events. throws: TransformerConfigurationException - If for some reason theTransformerHandler cannot be created. |
setConfiguration | public void setConfiguration(Configuration config)(Code) | | Set the configuration (en bloc)
|
setErrorListener | public void setErrorListener(ErrorListener listener) throws IllegalArgumentException(Code) | | Set the error event listener for the TransformerFactory, which
is used for the processing of transformation instructions,
and not for the transformation itself.
Parameters: listener - The new error listener. throws: IllegalArgumentException - if listener is null. |
setFeature | public void setFeature(String name, boolean value) throws TransformerConfigurationException(Code) | | Set a feature for this TransformerFactory and Transformer s
or Template s created by this factory.
Feature names are fully qualified
java.net.URI s.
Implementations may define their own features.
An
javax.xml.transform.TransformerConfigurationException is thrown if this TransformerFactory or the
Transformer s or Template s it creates cannot support the feature.
It is possible for an TransformerFactory to expose a feature value but be unable to change its state.
All implementations are required to support the FEATURE_SECURE_PROCESSING feature.
When the feature is:
Parameters: name - Feature name. Parameters: value - Is feature state true or false . throws: javax.xml.transform.TransformerConfigurationException - if this TransformerFactory or the Transformer s or Template s it creates cannot support this feature. throws: NullPointerException - If the name parameter is null. |
setURIResolver | public void setURIResolver(URIResolver resolver)(Code) | | Set an object that is used by default during the transformation
to resolve URIs used in xsl:import, or xsl:include.
Parameters: resolver - An object that implements the URIResolver interface,or null. |
|
|