|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.xml.transform.TransformerFactory
javax.xml.transform.sax.SAXTransformerFactory
jd.xml.xslt.trax.TransformerFactoryImpl
An implementation of the TrAX TransformerFactory class and
SAXTransformerFactory classes.
The following code fragment illustrates how to invoke jd.xslt
from TrAX:
import java.io.*;
import javax.xml.transform.*;
...
System.setProperty("javax.xml.transform.TransformerFactory",
"jd.xml.xslt.trax.TransformerFactoryImpl");
TransformerFactory tfactory = TransformerFactory.newInstance();
Source stylesheetSource = ...
Transformer transformer = tfactory.newTransformer(stylesheetSource);
transformer.transform(...);
Field Summary |
Fields inherited from class javax.xml.transform.sax.SAXTransformerFactory |
FEATURE, FEATURE_XMLFILTER |
Constructor Summary | |
TransformerFactoryImpl()
|
Method Summary | |
Source |
getAssociatedStylesheet(Source source,
String media,
String title,
String charset)
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. |
Object |
getAttribute(String name)
Throws an IllegalArgumentException since attributes are not supported. |
ErrorListener |
getErrorListener()
Get the error event handler for the TransformerFactory. |
boolean |
getFeature(String name)
Look up the value of a feature. |
URIResolver |
getURIResolver()
Return the URIResolver that was set with setURIResolver or the default resolver if no URIResolver was set. |
Templates |
newTemplates(Source source)
Process the Source into a Templates object, which is a a compiled representation of the source. |
Templates |
newTemplates(XmlSource source)
Process the Source into a Templates object, which is a a compiled representation of the source. |
TemplatesHandler |
newTemplatesHandler()
Get a TemplatesHandler object that can process SAX ContentHandler events into a Templates object. |
Transformer |
newTransformer()
Create a new Transformer object that performs a copy of the source to the result. |
Transformer |
newTransformer(Source source)
Process the Source into a Transformer object. |
TransformerHandler |
newTransformerHandler()
Get a TransformerHandler object that can process SAX ContentHandler events into a Result. |
TransformerHandler |
newTransformerHandler(Source source)
Get a TransformerHandler object that can process SAX ContentHandler events into a Result, based on the transformation instructions specified by the argument. |
TransformerHandler |
newTransformerHandler(Templates templates)
Get a TransformerHandler object that can process SAX ContentHandler events into a Result, based on the Templates argument. |
XMLFilter |
newXMLFilter(Source source)
Return null since XMLFilters are not supported. |
XMLFilter |
newXMLFilter(Templates templates)
Return null since XMLFilters are not supported. |
void |
setAttribute(String name,
Object value)
Throws an IllegalArgumentException since attributes are not supported. |
void |
setErrorListener(ErrorListener listener)
Set the error event listener for the TransformerFactory, which is used for the processing of transformation instructions, |
void |
setURIResolver(URIResolver traxUriResolver)
Set the URIResolver. |
Methods inherited from class javax.xml.transform.TransformerFactory |
newInstance |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TransformerFactoryImpl()
Method Detail |
public Transformer newTransformer(Source source) throws TransformerConfigurationException
source
- An object that holds a URI, input stream, etc.
TransformerConfigurationException
- May throw this during the parse
when it is constructing the Templates object and fails.public Transformer newTransformer() throws TransformerConfigurationException
TransformerConfigurationException
- May throw this during
the parse when it is constructing the
Templates object and fails.public Templates newTemplates(Source source) throws TransformerConfigurationException
source
- An object that holds a URL, input stream, etc.
TransformerConfigurationException
- May throw this during the parse when it
is constructing the Templates object and fails.public Templates newTemplates(XmlSource source) throws TransformerConfigurationException
TransformerConfigurationException
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException
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.
TransformerConfigurationException.
TransformerConfigurationException
public void setURIResolver(URIResolver traxUriResolver)
traxUriResolver
- An object that implements the URIResolver interface,
or null.public URIResolver getURIResolver()
public boolean getFeature(String name)
The feature name is any absolute URI.
name
- The feature name, which is an absolute URI.
public void setAttribute(String name, Object value) throws IllegalArgumentException
name
- The name of the attribute.value
- The value of the attribute.
IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.public Object getAttribute(String name) throws IllegalArgumentException
name
- The name of the attribute.
IllegalArgumentException
- thrown if the underlying
implementation doesn't recognize the attribute.public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
listener
- The new error listener.
IllegalArgumentException
- if listener is null.public ErrorListener getErrorListener()
public TemplatesHandler newTemplatesHandler()
SAXTransformerFactory
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException
SAXTransformerFactory
TransformerConfigurationException
- If for some reason the
TransformerHandler cannot be created.public TransformerHandler newTransformerHandler(Source source) throws TransformerConfigurationException
SAXTransformerFactory
source
- The Source of the transformation instructions.
TransformerConfigurationException
- If for some reason the
TransformerHandler can not be created.public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException
SAXTransformerFactory
templates
- The compiled transformation instructions.
TransformerConfigurationException
- If for some reason the
TransformerHandler can not be created.public XMLFilter newXMLFilter(Source source)
source
- The Source of the transformation instructions.
public XMLFilter newXMLFilter(Templates templates)
templates
- The compiled transformation instructions.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |