com.datapower.xml.xslt.xa
Class xaTransformer

java.lang.Object
  |
  +--javax.xml.transform.Transformer
        |
        +--com.datapower.xml.xslt.xa.xaTransformer

public class xaTransformer
extends javax.xml.transform.Transformer

xaTransformer is a standard part of the TRaX API. A transformer object is associated with the stylesheet and can be used by a single thread to perform the stylesheet-defined transformation using a variety of input and output methods. Use TransformFactory to create Transformer objects. See also TRAX documentation.


Method Summary
 void clearParameters()
          Clear all parameters set with setParameter.
 void close()
          Close the network connection between the xaTransformer and the device.
 void finalize()
          Closes the network connection between the xaTransformer and the device.
 boolean getDebug()
          Get the value of the debug attribute of the transformer instance.
 javax.xml.transform.ErrorListener getErrorListener()
          Get error listener for the transformer entity.
 java.util.Properties getOutputProperties()
          Gets output properties previously provided to the stylesheet.
 java.lang.String getOutputProperty(java.lang.String name)
          Gets output property previously provided to the stylesheet.
 java.lang.Object getParameter(java.lang.String name)
          Get a parameter that was explicitly set with setParameter or setParameters.
 com.datapower.xml.xslt.xa.xaProgressListener getProgressListener()
          Get the progress listener handler for the transformer instance.
 int getStylesheetTimeout()
          Get the value of the stylesheet timeout attribute of the transformer instance This is a DataPower-specific method.
 java.lang.String getTransformSerialNo()
          Get the transform serial number as assigned by the device This serial number can be used to correleate between logs on the device and the transformer instance.
 javax.xml.transform.URIResolver getURIResolver()
          Gets the current URI resolver in this transformer.
 boolean getValidate()
          Get the value of the validate attribute of the transformer instance This is a DataPower-specific method.
static void main(java.lang.String[] args)
          Allows for command line transformations.
 void refreshStylesheet()
          Force the contents of the stylesheet to be sent to the device, even if the stylesheet is already in cache on the device, and test whether it has changed since it was last compiled (if ever).
 java.lang.String reportStylesheet()
          Get the string representing all of the warnings and errors given by the last compilation.
 void setDebug(boolean debug)
          Set the value of the debug attribute of the transformer instance.
 void setErrorListener(javax.xml.transform.ErrorListener inListener)
          Set error listener for the transformer entity.
 void setOutputProperties(java.util.Properties inOutFormat)
          Sets output properties for the stylesheet.
 void setOutputProperty(java.lang.String name, java.lang.String value)
          Sets an output property for the stylesheet.
 void setParameter(java.lang.String name, java.lang.Object value)
          Add a parameter for the transformation.
 void setProgressListener(com.datapower.xml.xslt.xa.xaProgressListener listener)
          Set the progress listener for the transformer instance, which is used for the processing of transformation instructions, and not for the transformation itself.
 void setStylesheetTimeout(int inStylesheetTimeout)
          Set the value of the stylesheet timeout attribute of the transformer instance This is a DataPower-specific method.
 void setURIResolver(javax.xml.transform.URIResolver resolver)
          Sets URI resolver for this transformer.
 void setValidate(boolean inValidate)
          Set the value of the validate attribute of the transformer instance
 void transform(javax.xml.transform.Source xmlSource, javax.xml.transform.Result outputTarget)
          Transform xml from source and send to output target, using the stylesheet associated with this Transformer object instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
Add a parameter for the transformation.

Pass a qualified name as a two-part string, the namespace URI enclosed in curly braces ({}), followed by the local name. If the name has a null URL, the String only contain the local name. An application can safely check for a non-null URI by testing to see if the first character of the name is a '{' character.

For example, if a URI and local name were obtained from an element defined with , then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo". Note that no prefix is used.

setParameter() is a standard JAXP method.

Specified by:
setParameter in class javax.xml.transform.Transformer
Parameters:
name - The name of the parameter, which may begin with a namespace URI in curly braces ({}).
value - The value object. This can be any valid Java object. It is up to the processor to provide the proper object coersion or to simply pass the object on for use in an extension.

getParameter

public java.lang.Object getParameter(java.lang.String name)
Get a parameter that was explicitly set with setParameter or setParameters.

This method does not return a default parameter value, which cannot be determined until the node context is evaluated during the transformation process.

getParameter() is a standard JAXP method.

Specified by:
getParameter in class javax.xml.transform.Transformer
Returns:
A parameter that has been set with setParameter.

clearParameters

public void clearParameters()
Clear all parameters set with setParameter.

clearParameters() is a standard JAXP method.

Specified by:
clearParameters in class javax.xml.transform.Transformer

setErrorListener

public void setErrorListener(javax.xml.transform.ErrorListener inListener)
                      throws java.lang.IllegalArgumentException
Set error listener for the transformer entity. This is a standard method of the TRaX API.

Specified by:
setErrorListener in class javax.xml.transform.Transformer
Parameters:
inListener - This receives error event callbacks.
java.lang.IllegalArgumentException

getErrorListener

public javax.xml.transform.ErrorListener getErrorListener()
Get error listener for the transformer entity. This is a standard method of the TRaX API.

Specified by:
getErrorListener in class javax.xml.transform.Transformer
Returns:
inListener Returns currently active error event handler.

setOutputProperties

public void setOutputProperties(java.util.Properties inOutFormat)
                         throws java.lang.IllegalArgumentException
Sets output properties for the stylesheet. This is a standard method of the TRaX API.

Specified by:
setOutputProperties in class javax.xml.transform.Transformer
Parameters:
inOutFormat - The output properties.
java.lang.IllegalArgumentException

setOutputProperty

public void setOutputProperty(java.lang.String name,
                              java.lang.String value)
                       throws java.lang.IllegalArgumentException
Sets an output property for the stylesheet. This is a standard method of the TRaX API.

Specified by:
setOutputProperty in class javax.xml.transform.Transformer
Parameters:
name - This is the output property name.
value - This is the value of the property.
java.lang.IllegalArgumentException

getOutputProperties

public java.util.Properties getOutputProperties()
Gets output properties previously provided to the stylesheet. This is a standard method of the TRaX API.

Specified by:
getOutputProperties in class javax.xml.transform.Transformer
Returns:
Output properties.

getOutputProperty

public java.lang.String getOutputProperty(java.lang.String name)
                                   throws java.lang.IllegalArgumentException
Gets output property previously provided to the stylesheet. This is a standard method of the TRaX API.

Specified by:
getOutputProperty in class javax.xml.transform.Transformer
Parameters:
name - This is the output property name.
Returns:
String value of named output property.
java.lang.IllegalArgumentException

setURIResolver

public void setURIResolver(javax.xml.transform.URIResolver resolver)
Sets URI resolver for this transformer. This is a standard method of the TRaX API.

Specified by:
setURIResolver in class javax.xml.transform.Transformer
Parameters:
resolver - The object responsible for URI resolution.

getURIResolver

public javax.xml.transform.URIResolver getURIResolver()
Gets the current URI resolver in this transformer.

Specified by:
getURIResolver in class javax.xml.transform.Transformer
Returns:
Current resolver object.

transform

public void transform(javax.xml.transform.Source xmlSource,
                      javax.xml.transform.Result outputTarget)
               throws javax.xml.transform.TransformerException
Transform xml from source and send to output target, using the stylesheet associated with this Transformer object instance. This is a standard method of the TRaX API.

Specified by:
transform in class javax.xml.transform.Transformer
Parameters:
xmlSource - This object describes XML input document
outputTarget - This object describes XML output destination
javax.xml.transform.TransformerException

getTransformSerialNo

public java.lang.String getTransformSerialNo()
Get the transform serial number as assigned by the device This serial number can be used to correleate between logs on the device and the transformer instance. This is a DataPower-specific method.

Returns:
The current transform serial no or null.

getStylesheetTimeout

public int getStylesheetTimeout()
Get the value of the stylesheet timeout attribute of the transformer instance This is a DataPower-specific method.

Returns:
The value of the stylesheet timeout attribute.

setStylesheetTimeout

public void setStylesheetTimeout(int inStylesheetTimeout)
Set the value of the stylesheet timeout attribute of the transformer instance This is a DataPower-specific method.


getProgressListener

public com.datapower.xml.xslt.xa.xaProgressListener getProgressListener()
Get the progress listener handler for the transformer instance.

This is a DataPower-specific method.

Returns:
The current progress listener, which may or may not be null.

setProgressListener

public void setProgressListener(com.datapower.xml.xslt.xa.xaProgressListener listener)
Set the progress listener for the transformer instance, which is used for the processing of transformation instructions, and not for the transformation itself.

This is a DataPower-specific method.

Parameters:
listener - The new progress listener or null.

getValidate

public boolean getValidate()
Get the value of the validate attribute of the transformer instance This is a DataPower-specific method.

Returns:
The value of the debug attribute.

setValidate

public void setValidate(boolean inValidate)
Set the value of the validate attribute of the transformer instance


getDebug

public boolean getDebug()
Get the value of the debug attribute of the transformer instance. This is a DataPower-specific method.

Returns:
The value of the debug attribute.

setDebug

public void setDebug(boolean debug)
Set the value of the debug attribute of the transformer instance. This is a DataPower-specific method.

Parameters:
debug - The value of the debug attribute.

close

public void close()
Close the network connection between the xaTransformer and the device. This is a DataPower-specific method.


finalize

public void finalize()
Closes the network connection between the xaTransformer and the device. This is a DataPower-specific method.

Overrides:
finalize in class java.lang.Object

refreshStylesheet

public void refreshStylesheet()
                       throws javax.xml.transform.TransformerException
Force the contents of the stylesheet to be sent to the device, even if the stylesheet is already in cache on the device, and test whether it has changed since it was last compiled (if ever). Recompile the stylesheet and refresh it in the device's cache if it has changed. See also the "XAForceRefresh" attribute of xaTransformerFactory. This is a DataPower-specific method.

javax.xml.transform.TransformerException
See Also:
xaTransformerFactory.setAttribute(String name, Object value)

reportStylesheet

public java.lang.String reportStylesheet()
                                  throws javax.xml.transform.TransformerException
Get the string representing all of the warnings and errors given by the last compilation.

javax.xml.transform.TransformerException

main

public static final void main(java.lang.String[] args)
Allows for command line transformations. This is a DataPower-specific method.