Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.xml.transform.TransformerFactory
javax.xml.transform.sax.SAXTransformerFactory
org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl
public class SmartTransformerFactoryImpl
extends SAXTransformerFactory
Field Summary |
Fields inherited from class javax.xml.transform.sax.SAXTransformerFactory | |
FEATURE , FEATURE_XMLFILTER |
Constructor Summary | |
|
Method Summary | |
Source |
|
Object |
|
ErrorListener |
|
boolean |
|
URIResolver |
|
Templates |
|
TemplatesHandler |
|
Transformer |
|
Transformer |
|
TransformerHandler |
|
TransformerHandler |
|
TransformerHandler |
|
XMLFilter |
|
XMLFilter |
|
void |
|
void |
|
void |
|
Methods inherited from class javax.xml.transform.sax.SAXTransformerFactory | |
newTemplatesHandler , newTransformerHandler , newTransformerHandler , newTransformerHandler , newXMLFilter , newXMLFilter |
Methods inherited from class javax.xml.transform.TransformerFactory | |
getAssociatedStylesheet , getAttribute , getErrorListener , getFeature , getURIResolver , newInstance , newTemplates , newTransformer , newTransformer , setAttribute , setErrorListener , setURIResolver |
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.
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException
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 in a single stylesheet.
- Overrides:
- getAssociatedStylesheet in interface TransformerFactory
- Parameters:
source
- The XML source document.media
- The media attribute to be matched. May be null, in which case the prefered templates will be used (i.e. alternate = no).title
- The value of the title attribute to match. May be null.charset
- The value of the charset attribute to match. May be null.
- Returns:
- A Source object suitable for passing to the TransformerFactory.
public Object getAttribute(String name) throws IllegalArgumentException
Allows the user to retrieve specific attributes on the underlying implementation.
- Overrides:
- getAttribute in interface TransformerFactory
- Parameters:
name
- The name of the attribute.
- Returns:
- value The value of the attribute.
public ErrorListener getErrorListener()
Get the error event handler for the TransformerFactory.
- Overrides:
- getErrorListener in interface TransformerFactory
- Returns:
- The current error handler, which should never be null.
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.
- Overrides:
- getFeature in interface TransformerFactory
- Parameters:
name
- The feature name
- Returns:
- 'true' if feature is supported, 'false' if not
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.
- Overrides:
- getURIResolver in interface TransformerFactory
- Returns:
- The URIResolver that was set with setURIResolver.
public Templates newTemplates(Source source) throws TransformerConfigurationException
Create a Templates object that from the input stylesheet Uses the org.apache.xalan.xsltc.trax.TransformerFactory.
- Overrides:
- newTemplates in interface TransformerFactory
- Parameters:
source
- the stylesheet.
- Returns:
- A Templates object.
public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException
Get a TemplatesHandler object that can process SAX ContentHandler events into a Templates object. Uses the org.apache.xalan.xsltc.trax.TransformerFactory.
- Overrides:
- newTemplatesHandler in interface SAXTransformerFactory
public Transformer newTransformer() throws TransformerConfigurationException
Create a Transformer object that copies the input document to the result. Uses the org.apache.xalan.processor.TransformerFactory.
- Overrides:
- newTransformer in interface TransformerFactory
- Returns:
- A Transformer object.
public Transformer newTransformer(Source source) throws TransformerConfigurationException
Create a Transformer object that from the input stylesheet Uses the org.apache.xalan.processor.TransformerFactory.
- Overrides:
- newTransformer in interface TransformerFactory
- Parameters:
source
- the stylesheet.
- Returns:
- A Transformer object.
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException
Get a TransformerHandler object that can process SAX ContentHandler events based on a copy transformer. Uses org.apache.xalan.processor.TransformerFactory.
- Overrides:
- newTransformerHandler in interface SAXTransformerFactory
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.
- Overrides:
- newTransformerHandler in interface SAXTransformerFactory
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.
- Overrides:
- newTransformerHandler in interface SAXTransformerFactory
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException
Create an XMLFilter that uses the given source as the transformation instructions. Uses org.apache.xalan.xsltc.trax.TransformerFactory.
- Overrides:
- newXMLFilter in interface SAXTransformerFactory
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException
Create an XMLFilter, based on the Templates argument..
- Overrides:
- newXMLFilter in interface SAXTransformerFactory
- Parameters:
templates
- The compiled transformation instructions.
- Returns:
- An XMLFilter object, or null if this feature is not supported.
- Throws:
TransformerConfigurationException
- If for some reason the TemplatesHandler cannot be created.
public void setAttribute(String name, Object value) throws IllegalArgumentException
Allows the user to set specific attributes on the underlying implementation. An attribute in this context is defined to be an option that the implementation provides.
- Overrides:
- setAttribute in interface TransformerFactory
- Parameters:
name
- The name of the attribute.value
- The value of the attribute.
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
Set the error event listener for the TransformerFactory, which is used for the processing of transformation instructions, and not for the transformation itself.
- Overrides:
- setErrorListener in interface TransformerFactory
- Parameters:
listener
- The new error listener.
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.
- Overrides:
- setURIResolver in interface TransformerFactory
- Parameters:
resolver
- An object that implements the URIResolver interface, or null.