Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/javax/xml/transform/Templates.java
32285 views
/*1* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.transform;2627import java.util.Properties;2829303132/**33* An object that implements this interface is the runtime representation of processed34* transformation instructions.35*36* <p>Templates must be threadsafe for a given instance37* over multiple threads running concurrently, and may38* be used multiple times in a given session.</p>39*/40public interface Templates {4142/**43* Create a new transformation context for this Templates object.44*45* @return A valid non-null instance of a Transformer.46*47* @throws TransformerConfigurationException if a Transformer can not be created.48*/49Transformer newTransformer() throws TransformerConfigurationException;5051/**52* Get the properties corresponding to the effective xsl:output element.53* The object returned will54* be a clone of the internal values. Accordingly, it can be mutated55* without mutating the Templates object, and then handed in to56* {@link javax.xml.transform.Transformer#setOutputProperties}.57*58* <p>The properties returned should contain properties set by the stylesheet,59* and these properties are "defaulted" by default properties specified by60* <a href="http://www.w3.org/TR/xslt#output">section 16 of the61* XSL Transformations (XSLT) W3C Recommendation</a>. The properties that62* were specifically set by the stylesheet should be in the base63* Properties list, while the XSLT default properties that were not64* specifically set should be in the "default" Properties list. Thus,65* getOutputProperties().getProperty(String key) will obtain any66* property in that was set by the stylesheet, <em>or</em> the default67* properties, while68* getOutputProperties().get(String key) will only retrieve properties69* that were explicitly set in the stylesheet.</p>70*71* <p>For XSLT,72* <a href="http://www.w3.org/TR/xslt#attribute-value-templates">Attribute73* Value Templates</a> attribute values will74* be returned unexpanded (since there is no context at this point). The75* namespace prefixes inside Attribute Value Templates will be unexpanded,76* so that they remain valid XPath values.</p>77*78* @return A Properties object, never null.79*/80Properties getOutputProperties();81}828384