⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
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.
Author:
Andrew Selkirk, David Brownell

Constructor Summary

Transformer()

Default constructor, for use only by subclasses.

Method Summary

void

clearParameters()

Clears all parameter settings.

ErrorListener

getErrorListener()

Returns the error handler used as documents are transformed.

java.util.Properties

getOutputProperties()

Returns a copy of the transformer's non-default output properties.

java.lang.String

getOutputProperty(java.lang.String name)

Returns the value of a property applying to this transform.

java.lang.Object

getParameter(java.lang.String name)

Returns the value of a parameter passed to this transform.

URIResolver

getURIResolver()

Returns the resolver applied to documents being transformed.

void

setErrorListener(ErrorListener listener)

Assigns the error handler used as documents are transformed.

void

setOutputProperties(java.util.Properties outputformat)

Assigns a set of output properties, as if made by multiple calls to #setOutputProperty.

void

setOutputProperty(java.lang.String name, java.lang.String value)

Assigns the value of a transformation property, affecting generation of output (mostly text syntax).

void

setParameter(java.lang.String name, java.lang.Object value)

Assigns the value of a parameter passed to this transform.

void

setURIResolver(URIResolver resolver)

Assigns the resolver applied to documents being transformed.

void

transform(Source source, Result result)

Apply the appropriate transformation

Constructor Details

Transformer

protected Transformer()

Default constructor, for use only by subclasses.

Method Details

clearParameters

public void clearParameters()

Clears all parameter settings.

See Also:
setParameter

getErrorListener

public ErrorListener getErrorListener()

Returns the error handler used as documents are transformed.


getOutputProperties

public 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

getOutputProperty

public String getOutputProperty(java.lang.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.

Parameters:
name
See Also:
OutputKeys
setOutputProperty

getParameter

public 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.

Parameters:
name
See Also:
setParameter

getURIResolver

public URIResolver getURIResolver()

Returns the resolver applied to documents being transformed.


setErrorListener

public void setErrorListener(ErrorListener listener)

Assigns the error handler used as documents are transformed.

Parameters:
listener

setOutputProperties

public void setOutputProperties(java.util.Properties outputformat)

Assigns a set of output properties, as if made by multiple calls to setOutputProperty.

Parameters:
outputformat - set of properties, or null to reset all properties to their default values
See Also:
OutputKeys

setOutputProperty

public void setOutputProperty(java.lang.String name, java.lang.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
getOutputProperty
setOutputProperties

setParameter

public 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
clearParameters

setURIResolver

public void setURIResolver(URIResolver resolver)

Assigns the resolver applied to documents being transformed.

Parameters:
resolver

transform

public void transform(Source source, Result result)

Apply the appropriate transformation

Parameters:
source
result