|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.xml.transform.Transformer
net.sf.joost.trax.TransformerImpl
public class TransformerImpl
This class implements the Transformer-Interface for TraX. With a Transformer-object you can proceed transformations, but be careful, because a Transformer-object is not thread- safe. For threads you should use Templates.
Field Summary | |
---|---|
boolean |
cancelTransformation
This is a run-time flag (only used when DEBUG_MODE is true). |
static boolean |
DEBUG_MODE
This is a compile-time flag to enable or disable calling of trace listeners. |
private ErrorListener |
errorListener
|
private HashSet |
ignoredProperties
|
private static org.apache.commons.logging.Log |
log
|
private Processor |
processor
|
private Boolean |
reentryGuard
Synch object to gaurd against setting values from the TrAX interface or reentry while the transform is going on. |
private HashSet |
supportedProperties
|
private TraceManager |
traceManager
The trace manager. |
private URIResolver |
uriRes
|
Fields inherited from interface net.sf.joost.trax.TrAXConstants |
---|
ALLOW_EXTERNAL_FUNCTIONS, DEBUG_FEATURE, IDENTITY_TRANSFORM, KEY_OUTPUT_URI_RESOLVER, KEY_TH_RESOLVER, KEY_XSLT_FACTORY, MESSAGE_EMITTER_CLASS, OUTPUT_KEY_SUPPORT_DISABLE_OUTPUT_ESCAPING |
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 | |
---|---|
protected |
TransformerImpl(Processor processor)
Constructor |
Method Summary | |
---|---|
void |
clearParameters()
Clears all parameters |
ErrorListener |
getErrorListener()
Setter for errorListener |
Properties |
getOutputProperties()
Getter for Processor.outputProperties |
String |
getOutputProperty(String name)
Getter for an output property. |
Object |
getParameter(String name)
Getter for parameters. |
Processor |
getStxProcessor()
Getter for processor |
TraceManager |
getTraceManager()
Get an instance of the tracemanager for this transformation. |
URIResolver |
getURIResolver()
Getter for uriRes |
private boolean |
isValidOutputMethod(String value)
|
private void |
performResults(Result result,
StxEmitter out)
Performs the Result . |
void |
setErrorListener(ErrorListener listener)
|
void |
setOutputProperties(Properties oformat)
Setter for Processor.outputProperties |
void |
setOutputProperty(String name,
String value)
Setter for an output property. |
void |
setParameter(String name,
Object value)
Setter for parameters. |
void |
setURIResolver(URIResolver resolver)
Setter for uriRes |
void |
transform(Source xmlSource,
Result result)
Transforms a xml-source : SAXSource, DOMSource, StreamSource to SAXResult, DOMResult and StreamResult |
Methods inherited from class javax.xml.transform.Transformer |
---|
reset |
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 Processor processor
private URIResolver uriRes
private ErrorListener errorListener
private HashSet supportedProperties
private HashSet ignoredProperties
private Boolean reentryGuard
public static boolean DEBUG_MODE
public boolean cancelTransformation
DEBUG_MODE
is true). If
the value is true
, the transformation will be cancelled at
the next possible execution step.
private TraceManager traceManager
Constructor Detail |
---|
protected TransformerImpl(Processor processor)
processor
- A Processor
object.Method Detail |
---|
public TraceManager getTraceManager()
public void transform(Source xmlSource, Result result) throws TransformerException
transform
in class Transformer
xmlSource
- A Source
result
- A Result
TransformerException
private void performResults(Result result, StxEmitter out)
Result
.
result
- A Result
out
- StxEmitter
.public String getOutputProperty(String name) throws IllegalArgumentException
getOutputProperty
in class Transformer
name
- The key of the output property.
null
if not set.
IllegalArgumentException
public void setOutputProperty(String name, String value) throws IllegalArgumentException
setOutputProperty
in class Transformer
name
- The key of the outputProperty.value
- The value of the outputProperty.
IllegalArgumentException
public Properties getOutputProperties()
Processor.outputProperties
getOutputProperties
in class Transformer
public void setOutputProperties(Properties oformat) throws IllegalArgumentException
Processor.outputProperties
setOutputProperties
in class Transformer
oformat
- A Properties
object, that replaces the
current set of output properties.
IllegalArgumentException
private boolean isValidOutputMethod(String value)
true
if value
is a valid output
methodpublic URIResolver getURIResolver()
uriRes
getURIResolver
in class Transformer
URIResolver
public void setURIResolver(URIResolver resolver)
uriRes
setURIResolver
in class Transformer
resolver
- A URIResolver
object.public void clearParameters()
clearParameters
in class Transformer
public void setParameter(String name, Object value)
setParameter
in class Transformer
name
- The key of the parameter.value
- The value of the parameter.public Object getParameter(String name)
getParameter
in class Transformer
name
- The key-value of the parameter.
Object
according to the key-value or null.public void setErrorListener(ErrorListener listener) throws IllegalArgumentException
setErrorListener
in class Transformer
listener
-
IllegalArgumentException
public ErrorListener getErrorListener()
errorListener
getErrorListener
in class Transformer
ErrorListener
public Processor getStxProcessor()
processor
Processor
object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |