javax.xml.transform
Class Transformer

java.lang.Object
  |
  +--javax.xml.transform.Transformer

public abstract class Transformer
extends java.lang.Object

Apply a transformation from a source, populating a result. Transformers may be reused, but not concurrently.

Version:
1.0
Author:
Andrew Selkirk, David Brownell

Constructor Summary
protected Transformer()
          Default constructor, for use only by subclasses.
 
Method Summary
abstract  void clearParameters()
          Clears all parameter settings.
abstract  ErrorListener getErrorListener()
          Returns the error handler used as documents are transformed.
abstract  java.util.Properties getOutputProperties()
          Returns a copy of the transformer's non-default output properties.
abstract  java.lang.String getOutputProperty(java.lang.String name)
          Returns the value of a property applying to this transform.
abstract  java.lang.Object getParameter(java.lang.String name)
          Returns the value of a parameter passed to this transform.
abstract  URIResolver getURIResolver()
          Returns the resolver applied to documents being transformed.
abstract  void setErrorListener(ErrorListener listener)
          Assigns the error handler used as documents are transformed.
abstract  void setOutputProperties(java.util.Properties outputformat)
          Assigns a set of output properties, as if made by multiple calls to setOutputProperty(java.lang.String, java.lang.String).
abstract  void setOutputProperty(java.lang.String name, java.lang.String value)
          Assigns the value of a transformation property, affecting generation of output (mostly text syntax).
abstract  void setParameter(java.lang.String name, java.lang.Object value)
          Assigns the value of a parameter passed to this transform.
abstract  void setURIResolver(URIResolver resolver)
          Assigns the resolver applied to documents being transformed.
abstract  void transform(Source source, Result result)
          Apply the appropriate transformation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transformer

protected Transformer()
Default constructor, for use only by subclasses.
Method Detail

clearParameters

public abstract void clearParameters()
Clears all parameter settings.
See Also:
setParameter(java.lang.String, java.lang.Object)

getErrorListener

public abstract ErrorListener getErrorListener()
Returns the error handler used as documents are transformed.

getOutputProperties

public abstract java.util.Properties getOutputProperties()
Returns a copy of the transformer's non-default output properties. That is, properties set in the stylesheet or through methods on this class are not set.
See Also:
OutputKeys, setOutputProperties(java.util.Properties)

getOutputProperty

public abstract java.lang.String getOutputProperty(java.lang.String name)
                                            throws java.lang.IllegalArgumentException
Returns the value of a property applying to this transform. Values returned by this method are only those that have been set explicitly.
See Also:
OutputKeys, setOutputProperty(java.lang.String, java.lang.String)

getParameter

public abstract java.lang.Object getParameter(java.lang.String name)
Returns the value of a parameter passed to this transform. These are primarily for use access within transformations and extensions.
See Also:
setParameter(java.lang.String, java.lang.Object)

getURIResolver

public abstract URIResolver getURIResolver()
Returns the resolver applied to documents being transformed.

setErrorListener

public abstract void setErrorListener(ErrorListener listener)
                               throws java.lang.IllegalArgumentException
Assigns the error handler used as documents are transformed.

setOutputProperties

public abstract void setOutputProperties(java.util.Properties outputformat)
                                  throws java.lang.IllegalArgumentException
Assigns a set of output properties, as if made by multiple calls to setOutputProperty(java.lang.String, java.lang.String).
Parameters:
outputformat - set of properties, or null to reset all properties to their default values
See Also:
OutputKeys

setOutputProperty

public abstract void setOutputProperty(java.lang.String name,
                                       java.lang.String value)
                                throws java.lang.IllegalArgumentException
Assigns the value of a transformation property, affecting generation of output (mostly text syntax). Parameters include those defined by the xslt:output element. Default settings may be explicitly overridden.
Parameters:
name - an XML name, or a namespace-scoped XML name encoded as {uri}localName.
value - associated with the name
See Also:
OutputKeys, getOutputProperty(java.lang.String), setOutputProperties(java.util.Properties)

setParameter

public abstract void setParameter(java.lang.String name,
                                  java.lang.Object value)
Assigns the value of a parameter passed to this transform. These are primarily for use access within transformations and extensions.
Parameters:
name - an XML name, or a namespace-scoped XML name encoded as {uri}localName.
value - associated with the name
See Also:
getParameter(java.lang.String), clearParameters()

setURIResolver

public abstract void setURIResolver(URIResolver resolver)
Assigns the resolver applied to documents being transformed.

transform

public abstract void transform(Source source,
                               Result result)
                        throws TransformerException
Apply the appropriate transformation


Source code is under GPL (with library exception) in the JAXP project at http://www.gnu.org/software/classpathx/jaxp
This documentation was derived from that source code on 2001-11-20.