jaxp/src/share/classes/javax/xml/transform/Templates.java
author duke
Wed, 05 Jul 2017 16:52:33 +0200
changeset 2690 855108087caf
parent 6 7f561c08de6b
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
package javax.xml.transform;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import java.util.Properties;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * An object that implements this interface is the runtime representation of processed
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * transformation instructions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * <p>Templates must be threadsafe for a given instance
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * over multiple threads running concurrently, and may
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * be used multiple times in a given session.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
public interface Templates {
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
     * Create a new transformation context for this Templates object.
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
     * @return A valid non-null instance of a Transformer.
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
     * @throws TransformerConfigurationException if a Transformer can not be created.
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
    Transformer newTransformer() throws TransformerConfigurationException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
     * Get the properties corresponding to the effective xsl:output element.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
     * The object returned will
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
     * be a clone of the internal values. Accordingly, it can be mutated
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
     * without mutating the Templates object, and then handed in to
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
     * {@link javax.xml.transform.Transformer#setOutputProperties}.
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
     * <p>The properties returned should contain properties set by the stylesheet,
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
     * and these properties are "defaulted" by default properties specified by
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
     * <a href="http://www.w3.org/TR/xslt#output">section 16 of the
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
     * XSL Transformations (XSLT) W3C Recommendation</a>.  The properties that
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
     * were specifically set by the stylesheet should be in the base
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
     * Properties list, while the XSLT default properties that were not
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
     * specifically set should be in the "default" Properties list.  Thus,
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
     * getOutputProperties().getProperty(String key) will obtain any
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     * property in that was set by the stylesheet, <em>or</em> the default
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     * properties, while
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
     * getOutputProperties().get(String key) will only retrieve properties
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
     * that were explicitly set in the stylesheet.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * <p>For XSLT,
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     * <a href="http://www.w3.org/TR/xslt#attribute-value-templates">Attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     * Value Templates</a> attribute values will
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     * be returned unexpanded (since there is no context at this point).  The
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     * namespace prefixes inside Attribute Value Templates will be unexpanded,
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     * so that they remain valid XPath values.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     * @return A Properties object, never null.
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
    Properties getOutputProperties();
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
}