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) booleangetFeature(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) voidsetAttribute(String name, Object value) voidsetErrorListener(ErrorListener listener) voidsetFeature(String name, boolean value) Set a feature for thisSmartTransformerFactoryandTransformers orTemplates created by this factory.voidsetURIResolver(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:
setErrorListenerin classTransformerFactory- Throws:
IllegalArgumentException
-
getErrorListener
- Specified by:
getErrorListenerin classTransformerFactory
-
getAttribute
- Specified by:
getAttributein classTransformerFactory- Throws:
IllegalArgumentException
-
setAttribute
- Specified by:
setAttributein classTransformerFactory- Throws:
IllegalArgumentException
-
setFeature
Set a feature for this
SmartTransformerFactoryandTransformers orTemplates created by this factory.Feature names are fully qualified
URIs. Implementations may define their own features. AnTransformerConfigurationExceptionis thrown if thisTransformerFactoryor theTransformers orTemplates it creates cannot support the feature. It is possible for anTransformerFactoryto expose a feature value but be unable to change its state.See
TransformerFactoryfor full documentation of specific features.- Specified by:
setFeaturein classTransformerFactory- Parameters:
name- Feature name.value- Is feature statetrueorfalse.- Throws:
TransformerConfigurationException- if thisTransformerFactoryor theTransformers orTemplates it creates cannot support this feature.NullPointerException- If thenameparameter 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:
getFeaturein classTransformerFactory- Parameters:
name- The feature name- Returns:
- 'true' if feature is supported, 'false' if not
-
getURIResolver
- Specified by:
getURIResolverin classTransformerFactory
-
setURIResolver
- Specified by:
setURIResolverin classTransformerFactory
-
getAssociatedStylesheet
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException - Specified by:
getAssociatedStylesheetin 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:
newTransformerin 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:
newTransformerin 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:
newTemplatesin 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:
newTemplatesHandlerin 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:
newTransformerHandlerin 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:
newTransformerHandlerin 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:
newTransformerHandlerin 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:
newXMLFilterin classSAXTransformerFactory- Throws:
TransformerConfigurationException
-
newXMLFilter
- Specified by:
newXMLFilterin classSAXTransformerFactory- Throws:
TransformerConfigurationException
-