## 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

    public class SmartTransformerFactoryImpl

extends javax.xml.transform.sax.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

Field Summary

Fields inherited from class javax.xml.transform.sax.SAXTransformerFactory
`FEATURE, FEATURE_XMLFILTER`

Constructor Summary
`SmartTransformerFactoryImpl()` implementation of the SmartTransformerFactory.

Method Summary
`javax.xml.transform.Source` `getAssociatedStylesheet(javax.xml.transform.Source source, java.lang.String media, java.lang.String title, java.lang.String charset)`
`java.lang.Object` `getAttribute(java.lang.String name)`
`javax.xml.transform.ErrorListener` `getErrorListener()`
`boolean` `getFeature(java.lang.String name)` javax.xml.transform.sax.TransformerFactory implementation.
`javax.xml.transform.URIResolver` `getURIResolver()`
`javax.xml.transform.Templates` `newTemplates(javax.xml.transform.Source source)` Create a Templates object that from the input stylesheet Uses the org.apache.xalan.xsltc.trax.TransformerFactory.
`javax.xml.transform.sax.TemplatesHandler` `newTemplatesHandler()` Get a TemplatesHandler object that can process SAX ContentHandler events into a Templates object.
`javax.xml.transform.Transformer` `newTransformer()` Create a Transformer object that copies the input document to the result.
`javax.xml.transform.Transformer` `newTransformer(javax.xml.transform.Source source)` Create a Transformer object that from the input stylesheet Uses the org.apache.xalan.processor.TransformerFactory.
`javax.xml.transform.sax.TransformerHandler` `newTransformerHandler()` Get a TransformerHandler object that can process SAX ContentHandler events based on a copy transformer.
`javax.xml.transform.sax.TransformerHandler` `newTransformerHandler(javax.xml.transform.Source src)` Get a TransformerHandler object that can process SAX ContentHandler events based on a transformer specified by the stylesheet Source.
`javax.xml.transform.sax.TransformerHandler` `newTransformerHandler(javax.xml.transform.Templates templates)` Get a TransformerHandler object that can process SAX ContentHandler events based on a transformer specified by the stylesheet Source.
`org.xml.sax.XMLFilter` `newXMLFilter(javax.xml.transform.Source src)` Create an XMLFilter that uses the given source as the transformation instructions.
`org.xml.sax.XMLFilter` `newXMLFilter(javax.xml.transform.Templates templates)`
`void` `setAttribute(java.lang.String name, java.lang.Object value)`
`void` `setErrorListener(javax.xml.transform.ErrorListener listener)`
`void` `setFeature(java.lang.String name, boolean value)` Set a feature for this `SmartTransformerFactory` and `Transformer`s or `Template`s created by this factory.
`void` `setURIResolver(javax.xml.transform.URIResolver resolver)`

Methods inherited from class javax.xml.transform.TransformerFactory
`newInstance, newInstance`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

### setErrorListener

    public void setErrorListener(javax.xml.transform.ErrorListener listener)
                          throws java.lang.IllegalArgumentException

  Specified by:
    `setErrorListener` in class `javax.xml.transform.TransformerFactory`
  Throws:
    `java.lang.IllegalArgumentException`

### getErrorListener

    public javax.xml.transform.ErrorListener getErrorListener()

  Specified by:
    `getErrorListener` in class `javax.xml.transform.TransformerFactory`

### getAttribute

    public java.lang.Object getAttribute(java.lang.String name)
                                  throws java.lang.IllegalArgumentException

  Specified by:
    `getAttribute` in class `javax.xml.transform.TransformerFactory`
  Throws:
    `java.lang.IllegalArgumentException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.Object value)
                      throws java.lang.IllegalArgumentException

  Specified by:
    `setAttribute` in class `javax.xml.transform.TransformerFactory`
  Throws:
    `java.lang.IllegalArgumentException`

### setFeature

    public void setFeature(java.lang.String name,
                           boolean value)
                    throws javax.xml.transform.TransformerConfigurationException

  Set a feature for this `SmartTransformerFactory` and `Transformer`s or `Template`s created by this factory.

  Feature names are fully qualified `URI`s. Implementations may define their own features. An `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.

  See `TransformerFactory` for full documentation of specific features.

  Specified by:
    `setFeature` in class `javax.xml.transform.TransformerFactory`
  Parameters:
    `name` - Feature name.
    `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.
    `java.lang.NullPointerException` - If the `name` parameter is null.

### getFeature

    public boolean getFeature(java.lang.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.

  Specified by:
    `getFeature` in class `javax.xml.transform.TransformerFactory`
  Parameters:
    `name` - The feature name
  Returns:
    'true' if feature is supported, 'false' if not

### getURIResolver

    public javax.xml.transform.URIResolver getURIResolver()

  Specified by:
    `getURIResolver` in class `javax.xml.transform.TransformerFactory`

### setURIResolver

    public void setURIResolver(javax.xml.transform.URIResolver resolver)

  Specified by:
    `setURIResolver` in class `javax.xml.transform.TransformerFactory`

### getAssociatedStylesheet

    public javax.xml.transform.Source getAssociatedStylesheet(javax.xml.transform.Source source,
                                                              java.lang.String media,
                                                              java.lang.String title,
                                                              java.lang.String charset)
                                                       throws javax.xml.transform.TransformerConfigurationException

  Specified by:
    `getAssociatedStylesheet` in class `javax.xml.transform.TransformerFactory`
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newTransformer

    public javax.xml.transform.Transformer newTransformer()
                                                   throws javax.xml.transform.TransformerConfigurationException

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

  Specified by:
    `newTransformer` in class `javax.xml.transform.TransformerFactory`
  Returns:
    A Transformer object.
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newTransformer

    public javax.xml.transform.Transformer newTransformer(javax.xml.transform.Source source)
                                                   throws javax.xml.transform.TransformerConfigurationException

  Create a Transformer object that from the input stylesheet Uses the org.apache.xalan.processor.TransformerFactory.

  Specified by:
    `newTransformer` in class `javax.xml.transform.TransformerFactory`
  Parameters:
    `source` - the stylesheet.
  Returns:
    A Transformer object.
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newTemplates

    public javax.xml.transform.Templates newTemplates(javax.xml.transform.Source source)
                                               throws javax.xml.transform.TransformerConfigurationException

  Create a Templates object that from the input stylesheet Uses the org.apache.xalan.xsltc.trax.TransformerFactory.

  Specified by:
    `newTemplates` in class `javax.xml.transform.TransformerFactory`
  Parameters:
    `source` - the stylesheet.
  Returns:
    A Templates object.
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newTemplatesHandler

    public javax.xml.transform.sax.TemplatesHandler newTemplatesHandler()
                                                                 throws javax.xml.transform.TransformerConfigurationException

  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 class `javax.xml.transform.sax.SAXTransformerFactory`
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newTransformerHandler

    public javax.xml.transform.sax.TransformerHandler newTransformerHandler()
                                                                     throws javax.xml.transform.TransformerConfigurationException

  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 class `javax.xml.transform.sax.SAXTransformerFactory`
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newTransformerHandler

    public javax.xml.transform.sax.TransformerHandler newTransformerHandler(javax.xml.transform.Source src)
                                                                     throws javax.xml.transform.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 class `javax.xml.transform.sax.SAXTransformerFactory`
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newTransformerHandler

    public javax.xml.transform.sax.TransformerHandler newTransformerHandler(javax.xml.transform.Templates templates)
                                                                     throws javax.xml.transform.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 class `javax.xml.transform.sax.SAXTransformerFactory`
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newXMLFilter

    public org.xml.sax.XMLFilter newXMLFilter(javax.xml.transform.Source src)
                                       throws javax.xml.transform.TransformerConfigurationException

  Create an XMLFilter that uses the given source as the transformation instructions. Uses org.apache.xalan.xsltc.trax.TransformerFactory.

  Specified by:
    `newXMLFilter` in class `javax.xml.transform.sax.SAXTransformerFactory`
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### newXMLFilter

    public org.xml.sax.XMLFilter newXMLFilter(javax.xml.transform.Templates templates)
                                       throws javax.xml.transform.TransformerConfigurationException

  Specified by:
    `newXMLFilter` in class `javax.xml.transform.sax.SAXTransformerFactory`
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

Copyright © 2005 Apache XML Project. All Rights Reserved.