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. import java.util.Properties;
  9. /**
  10. * An object that implements this interface is the runtime representation of processed
  11. * transformation instructions.
  12. *
  13. * <p>Templates must be threadsafe for a given instance
  14. * over multiple threads running concurrently, and may
  15. * be used multiple times in a given session.</p>
  16. */
  17. public interface Templates {
  18. /**
  19. * Create a new transformation context for this Templates object.
  20. *
  21. * @return A valid non-null instance of a Transformer.
  22. *
  23. * @throws TransformerConfigurationException if a Transformer can not be created.
  24. */
  25. Transformer newTransformer() throws TransformerConfigurationException;
  26. /**
  27. * Get the properties corresponding to the effective xsl:output element.
  28. * The object returned will
  29. * be a clone of the internal values. Accordingly, it can be mutated
  30. * without mutating the Templates object, and then handed in to
  31. * {@link javax.xml.transform.Transformer#setOutputProperties}.
  32. *
  33. * <p>The properties returned should contain properties set by the stylesheet,
  34. * and these properties are "defaulted" by default properties specified by
  35. * <a href="http://www.w3.org/TR/xslt#output">section 16 of the
  36. * XSL Transformations (XSLT) W3C Recommendation</a>. The properties that
  37. * were specifically set by the stylesheet should be in the base
  38. * Properties list, while the XSLT default properties that were not
  39. * specifically set should be in the "default" Properties list. Thus,
  40. * getOutputProperties().getProperty(String key) will obtain any
  41. * property in that was set by the stylesheet, <em>or</em> the default
  42. * properties, while
  43. * getOutputProperties().get(String key) will only retrieve properties
  44. * that were explicitly set in the stylesheet.</p>
  45. *
  46. * <p>For XSLT,
  47. * <a href="http://www.w3.org/TR/xslt#attribute-value-templates">Attribute
  48. * Value Templates</a> attribute values will
  49. * be returned unexpanded (since there is no context at this point). The
  50. * namespace prefixes inside Attribute Value Templates will be unexpanded,
  51. * so that they remain valid XPath values.</p>
  52. *
  53. * @return A Properties object, never null.
  54. */
  55. Properties getOutputProperties();
  56. }