org.apache.xalan.xsltc.trax

Class SmartTransformerFactoryImpl

public class SmartTransformerFactoryImpl extends SAXTransformerFactory

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

Constructor Summary
SmartTransformerFactoryImpl()
implementation of the SmartTransformerFactory.
Method Summary
SourcegetAssociatedStylesheet(Source source, String media, String title, String charset)
ObjectgetAttribute(String name)
ErrorListenergetErrorListener()
booleangetFeature(String name)
javax.xml.transform.sax.TransformerFactory implementation.
URIResolvergetURIResolver()
TemplatesnewTemplates(Source source)
Create a Templates object that from the input stylesheet Uses the org.apache.xalan.xsltc.trax.TransformerFactory.
TemplatesHandlernewTemplatesHandler()
Get a TemplatesHandler object that can process SAX ContentHandler events into a Templates object.
TransformernewTransformer()
Create a Transformer object that copies the input document to the result.
TransformernewTransformer(Source source)
Create a Transformer object that from the input stylesheet Uses the org.apache.xalan.processor.TransformerFactory.
TransformerHandlernewTransformerHandler()
Get a TransformerHandler object that can process SAX ContentHandler events based on a copy transformer.
TransformerHandlernewTransformerHandler(Source src)
Get a TransformerHandler object that can process SAX ContentHandler events based on a transformer specified by the stylesheet Source.
TransformerHandlernewTransformerHandler(Templates templates)
Get a TransformerHandler object that can process SAX ContentHandler events based on a transformer specified by the stylesheet Source.
XMLFilternewXMLFilter(Source src)
Create an XMLFilter that uses the given source as the transformation instructions.
XMLFilternewXMLFilter(Templates templates)
voidsetAttribute(String name, Object value)
voidsetErrorListener(ErrorListener listener)
voidsetFeature(String name, boolean value)

Set a feature for this SmartTransformerFactory and Transformers or Templates created by this factory.

Feature names are fully qualified {@link java.net.URI}s.

voidsetURIResolver(URIResolver resolver)

Constructor Detail

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 Detail

getAssociatedStylesheet

public Source getAssociatedStylesheet(Source source, String media, String title, String charset)

getAttribute

public Object getAttribute(String name)

getErrorListener

public ErrorListener getErrorListener()

getFeature

public boolean getFeature(String name)
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.

Parameters: name The feature name

Returns: 'true' if feature is supported, 'false' if not

getURIResolver

public URIResolver getURIResolver()

newTemplates

public Templates newTemplates(Source source)
Create a Templates object that from the input stylesheet Uses the org.apache.xalan.xsltc.trax.TransformerFactory.

Parameters: source the stylesheet.

Returns: A Templates object.

newTemplatesHandler

public TemplatesHandler newTemplatesHandler()
Get a TemplatesHandler object that can process SAX ContentHandler events into a Templates object. Uses the org.apache.xalan.xsltc.trax.TransformerFactory.

newTransformer

public Transformer newTransformer()
Create a Transformer object that copies the input document to the result. Uses the org.apache.xalan.processor.TransformerFactory.

Returns: A Transformer object.

newTransformer

public Transformer newTransformer(Source source)
Create a Transformer object that from the input stylesheet Uses the org.apache.xalan.processor.TransformerFactory.

Parameters: source the stylesheet.

Returns: A Transformer object.

newTransformerHandler

public TransformerHandler newTransformerHandler()
Get a TransformerHandler object that can process SAX ContentHandler events based on a copy transformer. Uses org.apache.xalan.processor.TransformerFactory.

newTransformerHandler

public TransformerHandler newTransformerHandler(Source src)
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.

newTransformerHandler

public TransformerHandler newTransformerHandler(Templates templates)
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.

newXMLFilter

public XMLFilter newXMLFilter(Source src)
Create an XMLFilter that uses the given source as the transformation instructions. Uses org.apache.xalan.xsltc.trax.TransformerFactory.

newXMLFilter

public XMLFilter newXMLFilter(Templates templates)

setAttribute

public void setAttribute(String name, Object value)

setErrorListener

public void setErrorListener(ErrorListener listener)

setFeature

public void setFeature(String name, boolean value)

Set a feature for this SmartTransformerFactory and Transformers or Templates created by this factory.

Feature names are fully qualified {@link java.net.URI}s. Implementations may define their own features. An {@link TransformerConfigurationException} is thrown if this TransformerFactory or the Transformers or Templates it creates cannot support the feature. It is possible for an TransformerFactory to expose a feature value but be unable to change its state.

See {@link javax.xml.transform.TransformerFactory} for full documentation of specific features.

Parameters: name Feature name. value Is feature state true or false.

Throws: TransformerConfigurationException if this TransformerFactory or the Transformers or Templates it creates cannot support this feature. NullPointerException If the name parameter is null.

setURIResolver

public void setURIResolver(URIResolver resolver)
Copyright © 2005 Apache XML Project. All Rights Reserved.