Methods Summary |
---|
public abstract void | clearParameters()Clear all parameters set with setParameter.
|
public abstract javax.xml.transform.ErrorListener | getErrorListener()Get the error event handler in effect for the transformation.
Implementations must provide a default error listener.
|
public abstract java.util.Properties | getOutputProperties()Get a copy of the output properties for the transformation.
The properties returned should contain properties set by the user,
and properties set by the stylesheet, and these properties
are "defaulted" by default properties specified by
section 16 of the
XSL Transformations (XSLT) W3C Recommendation. The properties that
were specifically set by the user or the stylesheet should be in the base
Properties list, while the XSLT default properties that were not
specifically set should be the default Properties list. Thus,
getOutputProperties().getProperty(String key) will obtain any
property in that was set by {@link #setOutputProperty},
{@link #setOutputProperties}, in the stylesheet, or the default
properties, while
getOutputProperties().get(String key) will only retrieve properties
that were explicitly set by {@link #setOutputProperty},
{@link #setOutputProperties}, or in the stylesheet.
Note that mutation of the Properties object returned will not
effect the properties that the transformer contains.
If any of the argument keys are not recognized and are not
namespace qualified, the property will be ignored and not returned.
In other words the behaviour is not orthogonal with
{@link #setOutputProperties setOutputProperties}.
|
public abstract java.lang.String | getOutputProperty(java.lang.String name)Get an output property that is in effect for the transformer.
If a property has been set using {@link #setOutputProperty},
that value will be returned. Otherwise, if a property is explicitly
specified in the stylesheet, that value will be returned. If
the value of the property has been defaulted, that is, if no
value has been set explicitly either with {@link #setOutputProperty} or
in the stylesheet, the result may vary depending on
implementation and input stylesheet.
|
public abstract java.lang.Object | getParameter(java.lang.String name)Get a parameter that was explicitly set with setParameter.
This method does not return a default parameter value, which
cannot be determined until the node context is evaluated during
the transformation process.
|
public abstract javax.xml.transform.URIResolver | getURIResolver()Get an object that will be used to resolve URIs used in
document().
|
public void | reset()Reset this Transformer to its original configuration.
Transformer is reset to the same state as when it was created with
{@link TransformerFactory#newTransformer()},
{@link TransformerFactory#newTransformer(Source source)} or
{@link Templates#newTransformer()}.
reset() is designed to allow the reuse of existing Transformer s
thus saving resources associated with the creation of new Transformer s.
The reset Transformer is not guaranteed to have the same {@link URIResolver}
or {@link ErrorListener} Object s, e.g. {@link Object#equals(Object obj)}.
It is guaranteed to have a functionally equal URIResolver
and ErrorListener .
// implementors should override this method
throw new UnsupportedOperationException(
"This Transformer, \"" + this.getClass().getName() + "\", does not support the reset functionality."
+ " Specification \"" + this.getClass().getPackage().getSpecificationTitle() + "\""
+ " version \"" + this.getClass().getPackage().getSpecificationVersion() + "\""
);
|
public abstract void | setErrorListener(javax.xml.transform.ErrorListener listener)Set the error event listener in effect for the transformation.
|
public abstract void | setOutputProperties(java.util.Properties oformat)Set the output properties for the transformation. These
properties will override properties set in the Templates
with xsl:output.
If argument to this function is null, any properties
previously set are removed, and the value will revert to the value
defined in the templates object.
Pass a qualified property key 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 <xyz:foo
xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>,
then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo".
Note that no prefix is used.
An IllegalArgumentException is thrown if any of the
argument keys are not recognized and are not namespace qualified.
|
public abstract void | setOutputProperty(java.lang.String name, java.lang.String value)Set an output property that will be in effect for the
transformation.
Pass a qualified property 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 <xyz:foo
xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>,
then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo".
Note that no prefix is used.
The Properties object that was passed to {@link #setOutputProperties}
won't be effected by calling this method.
|
public abstract 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 <xyz:foo
xmlns:xyz="http://xyz.foo.com/yada/baz.html"/>,
then the qualified name would be "{http://xyz.foo.com/yada/baz.html}foo".
Note that no prefix is used.
|
public abstract void | setURIResolver(javax.xml.transform.URIResolver resolver)Set an object that will be used to resolve URIs used in
document().
If the resolver argument is null, the URIResolver value will
be cleared and the transformer will no longer have a resolver.
|
public abstract void | transform(javax.xml.transform.Source xmlSource, javax.xml.transform.Result outputTarget)Transform the XML Source to a Result .
Specific transformation behavior is determined by the settings of the
TransformerFactory in effect when the
Transformer was instantiated and any modifications made to
the Transformer instance.
An empty Source is represented as an empty document
as constructed by {@link javax.xml.parsers.DocumentBuilder#newDocument()}.
The result of transforming an empty Source depends on
the transformation behavior; it is not always an empty
Result .
|