javax.xml.transform

Class Transformer

public abstract class Transformer extends 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 voidclearParameters()
Clears all parameter settings.
abstract ErrorListenergetErrorListener()
Returns the error handler used as documents are transformed.
abstract PropertiesgetOutputProperties()
Returns a copy of the transformer's non-default output properties.
abstract StringgetOutputProperty(String name)
Returns the value of a property applying to this transform.
abstract ObjectgetParameter(String name)
Returns the value of a parameter passed to this transform.
abstract URIResolvergetURIResolver()
Returns the resolver applied to documents being transformed.
abstract voidsetErrorListener(ErrorListener listener)
Assigns the error handler used as documents are transformed.
abstract voidsetOutputProperties(Properties outputformat)
Assigns a set of output properties, as if made by multiple calls to Transformer.
abstract voidsetOutputProperty(String name, String value)
Assigns the value of a transformation property, affecting generation of output (mostly text syntax).
abstract voidsetParameter(String name, Object value)
Assigns the value of a parameter passed to this transform.
abstract voidsetURIResolver(URIResolver resolver)
Assigns the resolver applied to documents being transformed.
abstract voidtransform(Source source, Result result)
Apply the appropriate transformation

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: Transformer

getErrorListener

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

getOutputProperties

public abstract 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 Transformer

getOutputProperty

public abstract String getOutputProperty(String name)
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 Transformer

getParameter

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

See Also: Transformer

getURIResolver

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

setErrorListener

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

setOutputProperties

public abstract void setOutputProperties(Properties outputformat)
Assigns a set of output properties, as if made by multiple calls to Transformer.

Parameters: outputformat set of properties, or null to reset all properties to their default values

See Also: OutputKeys

setOutputProperty

public abstract void setOutputProperty(String name, String value)
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 Transformer Transformer

setParameter

public abstract void setParameter(String name, 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: Transformer Transformer

setURIResolver

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

transform

public abstract void transform(Source source, Result result)
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 2011-08-26.