|
||||||||||
| 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
net.sf.joost.trax.TransformerFactoryImpl
This class implements the TransformerFactory-Interface for TraX. With the help of this factory you can get a templates-object or directly a transformer-object for the transformation process. If you use a SAXResult you can simply downcast to SAXTransformerFactory and use it like a Sax-Parser.
| Field Summary | |
protected boolean |
allowExternalFunctions
|
private boolean |
debugmode
|
protected ConfigurationErrListener |
defaultErrorListener
|
private ErrorListener |
errorListener
|
private static org.apache.commons.logging.Log |
log
|
private StxEmitter |
msgEmitter
|
private ParserListenerMgr |
parserListenerMgr
The parserlistener manager for tracing purpose. |
private Boolean |
reentryGuard
|
protected TransformerHandlerResolver |
thResolver
|
private URIResolver |
uriResolver
|
| Fields inherited from class javax.xml.transform.sax.SAXTransformerFactory |
FEATURE, FEATURE_XMLFILTER |
| Fields inherited from interface net.sf.joost.trax.TrAXConstants |
ALLOW_EXTERNAL_FUNCTIONS, DEBUG_FEATURE, IDENTITY_TRANSFORM, KEY_TH_RESOLVER, KEY_XSLT_FACTORY, MESSAGE_EMITTER_CLASS |
| Fields inherited from interface net.sf.joost.Constants |
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS |
| Constructor Summary | |
TransformerFactoryImpl()
The default constructor. |
|
| Method Summary | |
StxEmitter |
buildMessageEmitter(String emitterClass)
Method creates a new Emitter for stx:message output |
Source |
getAssociatedStylesheet(Source source,
String media,
String title,
String charset)
Returns the Source of the stylesheet associated with
the xml-document.
|
Object |
getAttribute(String name)
Allows the user to retrieve specific attributes of the underlying implementation. |
ErrorListener |
getErrorListener()
Getter for errorListener |
boolean |
getFeature(String name)
Supplied features. |
StxEmitter |
getMessageEmitter()
returns the value of msgEmitter |
ParserListenerMgr |
getParserListenerMgr()
returns the value of parserListenerMgr |
URIResolver |
getURIResolver()
Getter for uriResolver |
private Class |
loadClass(String className)
|
Templates |
newTemplates(Source source)
Creates a new Templates for Transformations. |
TemplatesHandler |
newTemplatesHandler()
Gets a TemplatesHandler object that can process
SAX ContentHandler events into a Templates object.
|
Transformer |
newTransformer()
Creates a new Transformer object that performs a copy of the source to the result. |
Transformer |
newTransformer(Source source)
Gets a new Transformer object for transformation. |
TransformerHandler |
newTransformerHandler()
Gets a TransformerHandler object that can process
SAX ContentHandler events into a Result.
|
TransformerHandler |
newTransformerHandler(Source src)
Gets 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)
Gets a TransformerHandler object that can process
SAX ContentHandler events into a Result, based on the Templates argument.
|
XMLFilter |
newXMLFilter(Source src)
Creates an XMLFilter that uses the given Source
as the transformation instructions.
|
XMLFilter |
newXMLFilter(Templates templates)
Creates an XMLFilter, based on the Templates argument. |
void |
setAttribute(String name,
Object value)
Allows the user to set specific attributes on the underlying implementation. |
void |
setErrorListener(ErrorListener errorListener)
Setter for errorListener |
void |
setFeature(String name,
boolean value)
see javax.xml.transform.TransformerFactory#setFeature(java.lang.String, boolean) |
void |
setURIResolver(URIResolver resolver)
Setter for 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 |
| Field Detail |
private static org.apache.commons.logging.Log log
private URIResolver uriResolver
private ErrorListener errorListener
protected TransformerHandlerResolver thResolver
protected boolean allowExternalFunctions
protected ConfigurationErrListener defaultErrorListener
private boolean debugmode
private StxEmitter msgEmitter
private Boolean reentryGuard
private ParserListenerMgr parserListenerMgr
| Constructor Detail |
public TransformerFactoryImpl()
throws IOException
| Method Detail |
public Source getAssociatedStylesheet(Source source,
String media,
String title,
String charset)
throws TransformerConfigurationException
Source of the stylesheet associated with
the xml-document.
Feature is not supported.
source - The Source of the xml-document.media - Matching media-type.title - Matching title-type.charset - Matching charset-type.
Source of the stylesheet.
TransformerConfigurationException
public Object getAttribute(String name)
throws IllegalArgumentException
name - The attribute name.
IllegalArgumentException - When such a attribute does not exists.
public void setAttribute(String name,
Object value)
throws IllegalArgumentException
name - Name of the attribute (key)value - Value of the attribute.
IllegalArgumentExceptionpublic ErrorListener getErrorListener()
errorListener
ErrorListener
public void setErrorListener(ErrorListener errorListener)
throws IllegalArgumentException
errorListener
errorListener - The ErrorListener object.
IllegalArgumentExceptionpublic URIResolver getURIResolver()
uriResolver
URIResolverpublic void setURIResolver(URIResolver resolver)
uriResolver
resolver - The URIResolver object.
public void setFeature(String name,
boolean value)
throws TransformerConfigurationException
javax.xml.transform.TransformerFactory#setFeature(java.lang.String, boolean)
TransformerConfigurationExceptionpublic boolean getFeature(String name)
name - Name of the feature.
public Templates newTemplates(Source source)
throws TransformerConfigurationException
source - The Source of the stylesheet.
Templates object or null when an error
occured (no user defined ErrorListener)
TransformerConfigurationException
public Transformer newTransformer()
throws TransformerConfigurationException
Transformer object for an identical
transformation.
TransformerConfigurationException
public Transformer newTransformer(Source source)
throws TransformerConfigurationException
source - The Source of the stylesheet.
Transformer object according to the
Templates object.
TransformerConfigurationException
public TemplatesHandler newTemplatesHandler()
throws TransformerConfigurationException
TemplatesHandler object that can process
SAX ContentHandler events into a Templates object.
Implementation of the SAXTransformerFactory
TemplatesHandler ready to parse a stylesheet.
TransformerConfigurationExceptionSAXTransformerFactory
public TransformerHandler newTransformerHandler()
throws TransformerConfigurationException
TransformerHandler object that can process
SAX ContentHandler events into a Result.
The transformation is defined as an identity (or copy) transformation,
for example to copy a series of SAX parse events into a DOM tree.
Implementation of the SAXTransformerFactory
TransformerHandler ready to transform SAX events.
TransformerConfigurationException
public TransformerHandler newTransformerHandler(Source src)
throws TransformerConfigurationException
TransformerHandler object that can process
SAX ContentHandler events into a Result, based on the transformation
instructions specified by the argument.
Implementation of the SAXTransformerFactory
src - The Source of the transformation instructions
TransformerHandler ready to transform SAX events.
TransformerConfigurationException
public TransformerHandler newTransformerHandler(Templates templates)
throws TransformerConfigurationException
TransformerHandler object that can process
SAX ContentHandler events into a Result, based on the Templates argument.
Implementation of the SAXTransformerFactory
templates - - The compiled transformation instructions.
TransformerHandler ready to transform SAX events.
TransformerConfigurationException
public XMLFilter newXMLFilter(Source src)
throws TransformerConfigurationException
XMLFilter that uses the given Source
as the transformation instructions.
Implementation of the SAXTransformerFactory
src - - The Source of the transformation instructions.
XMLFilter object, or null if this feature is not
supported.
TransformerConfigurationExceptionpublic XMLFilter newXMLFilter(Templates templates)
SAXTransformerFactory
templates - - The compiled transformation instructions.
XMLFilter object, or null if this feature is not
supported.public ParserListenerMgr getParserListenerMgr()
parserListenerMgr
public StxEmitter getMessageEmitter()
msgEmitter
public StxEmitter buildMessageEmitter(String emitterClass)
throws TransformerConfigurationException
emitterClass - the name of the emitter class
StxEmitter
TransformerConfigurationException - in case of errors
private Class loadClass(String className)
throws TransformerConfigurationException
TransformerConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||