KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > transform > Templates


1 /*
2  * @(#)Templates.java 1.15 04/07/26
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.xml.transform;
8
9 import java.util.Properties JavaDoc;
10
11
12
13
14 /**
15  * An object that implements this interface is the runtime representation of processed
16  * transformation instructions.
17  *
18  * <p>Templates must be threadsafe for a given instance
19  * over multiple threads running concurrently, and may
20  * be used multiple times in a given session.</p>
21  */

22 public interface Templates {
23
24     /**
25      * Create a new transformation context for this Templates object.
26      *
27      * @return A valid non-null instance of a Transformer.
28      *
29      * @throws TransformerConfigurationException if a Transformer can not be created.
30      */

31     Transformer JavaDoc newTransformer() throws TransformerConfigurationException JavaDoc;
32
33     /**
34      * Get the properties corresponding to the effective xsl:output element.
35      * The object returned will
36      * be a clone of the internal values. Accordingly, it can be mutated
37      * without mutating the Templates object, and then handed in to
38      * {@link javax.xml.transform.Transformer#setOutputProperties}.
39      *
40      * <p>The properties returned should contain properties set by the stylesheet,
41      * and these properties are "defaulted" by default properties specified by
42      * <a HREF="http://www.w3.org/TR/xslt#output">section 16 of the
43      * XSL Transformations (XSLT) W3C Recommendation</a>. The properties that
44      * were specifically set by the stylesheet should be in the base
45      * Properties list, while the XSLT default properties that were not
46      * specifically set should be in the "default" Properties list. Thus,
47      * getOutputProperties().getProperty(String key) will obtain any
48      * property in that was set by the stylesheet, <em>or</em> the default
49      * properties, while
50      * getOutputProperties().get(String key) will only retrieve properties
51      * that were explicitly set in the stylesheet.</p>
52      *
53      * <p>For XSLT,
54      * <a HREF="http://www.w3.org/TR/xslt#attribute-value-templates">Attribute
55      * Value Templates</a> attribute values will
56      * be returned unexpanded (since there is no context at this point). The
57      * namespace prefixes inside Attribute Value Templates will be unexpanded,
58      * so that they remain valid XPath values.</p>
59      *
60      * @return A Properties object, never null.
61      */

62     Properties JavaDoc getOutputProperties();
63 }
64
Popular Tags