Package org.apache.xalan.xsltc.trax
Class SmartTransformerFactoryImpl
java.lang.Object
javax.xml.transform.TransformerFactory
javax.xml.transform.sax.SAXTransformerFactory
org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl
Implementation of a transformer factory that uses an XSLTC
transformer factory for the creation of Templates objects
and uses the Xalan processor transformer factory for the
creation of Transformer objects.
- Author:
- G. Todd Miller
-
Field Summary
Fields inherited from class javax.xml.transform.sax.SAXTransformerFactory
FEATURE, FEATURE_XMLFILTER
-
Constructor Summary
ConstructorsConstructorDescriptionimplementation of the SmartTransformerFactory. -
Method Summary
Modifier and TypeMethodDescriptiongetAssociatedStylesheet
(Source source, String media, String title, String charset) getAttribute
(String name) boolean
getFeature
(String name) javax.xml.transform.sax.TransformerFactory implementation.newTemplates
(Source source) Create a Templates object that from the input stylesheet Uses the org.apache.xalan.xsltc.trax.TransformerFactory.Get a TemplatesHandler object that can process SAX ContentHandler events into a Templates object.Create a Transformer object that copies the input document to the result.newTransformer
(Source source) Create a Transformer object that from the input stylesheet Uses the org.apache.xalan.processor.TransformerFactory.Get a TransformerHandler object that can process SAX ContentHandler events based on a copy transformer.Get a TransformerHandler object that can process SAX ContentHandler events based on a transformer specified by the stylesheet Source.newTransformerHandler
(Templates templates) Get a TransformerHandler object that can process SAX ContentHandler events based on a transformer specified by the stylesheet Source.newXMLFilter
(Source src) Create an XMLFilter that uses the given source as the transformation instructions.newXMLFilter
(Templates templates) void
setAttribute
(String name, Object value) void
setErrorListener
(ErrorListener listener) void
setFeature
(String name, boolean value) Set a feature for thisSmartTransformerFactory
andTransformer
s orTemplate
s created by this factory.void
setURIResolver
(URIResolver resolver) Methods inherited from class javax.xml.transform.TransformerFactory
newDefaultInstance, newInstance, newInstance
-
Constructor Details
-
SmartTransformerFactoryImpl
public SmartTransformerFactoryImpl()implementation of the SmartTransformerFactory. This factory uses org.apache.xalan.xsltc.trax.TransformerFactory to return Templates objects; and uses org.apache.xalan.processor.TransformerFactory to return Transformer objects.
-
-
Method Details
-
setErrorListener
- Specified by:
setErrorListener
in classTransformerFactory
- Throws:
IllegalArgumentException
-
getErrorListener
- Specified by:
getErrorListener
in classTransformerFactory
-
getAttribute
- Specified by:
getAttribute
in classTransformerFactory
- Throws:
IllegalArgumentException
-
setAttribute
- Specified by:
setAttribute
in classTransformerFactory
- Throws:
IllegalArgumentException
-
setFeature
Set a feature for this
SmartTransformerFactory
andTransformer
s orTemplate
s created by this factory.Feature names are fully qualified
URI
s. Implementations may define their own features. AnTransformerConfigurationException
is thrown if thisTransformerFactory
or theTransformer
s orTemplate
s it creates cannot support the feature. It is possible for anTransformerFactory
to expose a feature value but be unable to change its state.See
TransformerFactory
for full documentation of specific features.- Specified by:
setFeature
in classTransformerFactory
- Parameters:
name
- Feature name.value
- Is feature statetrue
orfalse
.- Throws:
TransformerConfigurationException
- if thisTransformerFactory
or theTransformer
s orTemplate
s it creates cannot support this feature.NullPointerException
- If thename
parameter is null.
-
getFeature
javax.xml.transform.sax.TransformerFactory implementation. Look up the value of a feature (to see if it is supported). This method must be updated as the various methods and features of this class are implemented.- Specified by:
getFeature
in classTransformerFactory
- Parameters:
name
- The feature name- Returns:
- 'true' if feature is supported, 'false' if not
-
getURIResolver
- Specified by:
getURIResolver
in classTransformerFactory
-
setURIResolver
- Specified by:
setURIResolver
in classTransformerFactory
-
getAssociatedStylesheet
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException - Specified by:
getAssociatedStylesheet
in classTransformerFactory
- Throws:
TransformerConfigurationException
-
newTransformer
Create a Transformer object that copies the input document to the result. Uses the org.apache.xalan.processor.TransformerFactory.- Specified by:
newTransformer
in classTransformerFactory
- Returns:
- A Transformer object.
- Throws:
TransformerConfigurationException
-
newTransformer
Create a Transformer object that from the input stylesheet Uses the org.apache.xalan.processor.TransformerFactory.- Specified by:
newTransformer
in classTransformerFactory
- Parameters:
source
- the stylesheet.- Returns:
- A Transformer object.
- Throws:
TransformerConfigurationException
-
newTemplates
Create a Templates object that from the input stylesheet Uses the org.apache.xalan.xsltc.trax.TransformerFactory.- Specified by:
newTemplates
in classTransformerFactory
- Parameters:
source
- the stylesheet.- Returns:
- A Templates object.
- Throws:
TransformerConfigurationException
-
newTemplatesHandler
Get a TemplatesHandler object that can process SAX ContentHandler events into a Templates object. Uses the org.apache.xalan.xsltc.trax.TransformerFactory.- Specified by:
newTemplatesHandler
in classSAXTransformerFactory
- Throws:
TransformerConfigurationException
-
newTransformerHandler
Get a TransformerHandler object that can process SAX ContentHandler events based on a copy transformer. Uses org.apache.xalan.processor.TransformerFactory.- Specified by:
newTransformerHandler
in classSAXTransformerFactory
- Throws:
TransformerConfigurationException
-
newTransformerHandler
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException Get a TransformerHandler object that can process SAX ContentHandler events based on a transformer specified by the stylesheet Source. Uses org.apache.xalan.processor.TransformerFactory.- Specified by:
newTransformerHandler
in classSAXTransformerFactory
- Throws:
TransformerConfigurationException
-
newTransformerHandler
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException Get a TransformerHandler object that can process SAX ContentHandler events based on a transformer specified by the stylesheet Source. Uses org.apache.xalan.xsltc.trax.TransformerFactory.- Specified by:
newTransformerHandler
in classSAXTransformerFactory
- Throws:
TransformerConfigurationException
-
newXMLFilter
Create an XMLFilter that uses the given source as the transformation instructions. Uses org.apache.xalan.xsltc.trax.TransformerFactory.- Specified by:
newXMLFilter
in classSAXTransformerFactory
- Throws:
TransformerConfigurationException
-
newXMLFilter
- Specified by:
newXMLFilter
in classSAXTransformerFactory
- Throws:
TransformerConfigurationException
-