org.apache.xalan.templates
Class OutputProperties

java.lang.Object
  |
  +--org.apache.xml.utils.UnImplNode
        |
        +--org.apache.xalan.templates.ElemTemplateElement
              |
              +--org.apache.xalan.templates.OutputProperties

public class OutputProperties
extends ElemTemplateElement
implements java.lang.Cloneable

This class provides information from xsl:output elements. It is mainly a wrapper for Properties, but can not extend that class because it must be part of the ElemTemplateElement heararchy.

An OutputProperties list can contain another OutputProperties list as its "defaults"; this second property list is searched if the property key is not found in the original property list.

See Also:
XSLT DTD, xsl:output in XSLT Specification, Serialized Form

Field Summary
static java.lang.String S_KEY_CONTENT_HANDLER
          Fully qualified name of class with a default constructor that implements the ContentHandler interface, where the result tree events will be sent to.
static java.lang.String S_KEY_ENTITIES
          File name of file that specifies character to entity reference mappings.
static java.lang.String S_KEY_INDENT_AMOUNT
          The number of whitespaces to indent by, if indent="yes".
static java.lang.String S_USE_URL_ESCAPING
          Use a value of "yes" if the href values for HTML serialization should use %xx escaping.
 
Constructor Summary
OutputProperties()
          Creates an empty OutputProperties with no default values.
OutputProperties(java.util.Properties defaults)
          Creates an empty OutputProperties with the specified defaults.
OutputProperties(java.lang.String method)
          Creates an empty OutputProperties with the defaults specified by a property file.
 
Method Summary
 java.lang.Object clone()
          Clone this OutputProperties, including a clone of the wrapped Properties reference.
 void compose()
          This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition.
 void copyFrom(OutputProperties opsrc)
          Copy the keys and values from the source to this object.
 void copyFrom(java.util.Properties src)
          Copy the keys and values from the source to this object.
 void copyFrom(java.util.Properties src, boolean shouldResetDefaults)
          Copy the keys and values from the source to this object.
 boolean getBooleanProperty(QName key)
          Searches for the boolean property with the specified key in the property list.
 boolean getBooleanProperty(java.lang.String key)
          Searches for the boolean property with the specified key in the property list.
static boolean getBooleanProperty(java.lang.String key, java.util.Properties props)
          Searches for the boolean property with the specified key in the property list.
static java.util.Properties getDefaultMethodProperties(java.lang.String method)
          Creates an empty OutputProperties with the defaults specified by a property file.
 int getIntProperty(QName key)
          Searches for the int property with the specified key in the property list.
 int getIntProperty(java.lang.String key)
          Searches for the int property with the specified key in the property list.
static int getIntProperty(java.lang.String key, java.util.Properties props)
          Searches for the int property with the specified key in the property list.
 java.util.Properties getProperties()
          Get the Properties object that this class wraps.
 java.lang.String getProperty(QName key)
          Searches for the property with the specified key in the property list.
 java.lang.String getProperty(java.lang.String key)
          Searches for the property with the specified key in the property list.
 java.util.Vector getQNameProperties(QName key)
          Searches for the list of qname properties with the specified key in the property list.
 java.util.Vector getQNameProperties(java.lang.String key)
          Searches for the list of qname properties with the specified key in the property list.
static java.util.Vector getQNameProperties(java.lang.String key, java.util.Properties props)
          Searches for the list of qname properties with the specified key in the property list.
 QName getQNameProperty(QName key)
          Searches for the qname property with the specified key in the property list.
 QName getQNameProperty(java.lang.String key)
          Searches for the qname property with the specified key in the property list.
static QName getQNameProperty(java.lang.String key, java.util.Properties props)
          Searches for the qname property with the specified key in the property list.
 boolean isLegalPropertyKey(java.lang.String key)
          Report if the key given as an argument is a legal xsl:output key.
 void recompose(StylesheetRoot root)
          This function is called to recompose all of the output format extended elements.
 void setBooleanProperty(QName key, boolean value)
          Set an output property.
 void setBooleanProperty(java.lang.String key, boolean value)
          Set an output property.
 void setIntProperty(QName key, int value)
          Set an output property.
 void setIntProperty(java.lang.String key, int value)
          Set an output property.
 void setMethodDefaults(java.lang.String method)
          Reset the default properties based on the method.
 void setProperty(QName key, java.lang.String value)
          Set an output property.
 void setProperty(java.lang.String key, java.lang.String value)
          Set an output property.
 void setQNameProperties(QName key, java.util.Vector v)
          Set an output property with a QName list value.
 void setQNameProperties(java.lang.String key, java.util.Vector v)
          Set an output property with a QName list value.
 void setQNameProperty(QName key, QName value)
          Set an output property with a QName value.
 void setQNameProperty(java.lang.String key, QName value)
          Set an output property with a QName value.
 
Methods inherited from class org.apache.xalan.templates.ElemTemplateElement
appendChild, canStripWhiteSpace, compareTo, containsExcludeResultPrefix, error, execute, getBaseIdentifier, getChildNodes, getColumnNumber, getDeclaredPrefixes, getDOMBackPointer, getFirstChild, getFirstChildElem, getLastChild, getLength, getLineNumber, getNamespaceForPrefix, getNamespaceForPrefix, getNextSibling, getNextSiblingElem, getNodeName, getNodeType, getOwnerDocument, getParentElem, getParentNode, getPrefixes, getPreviousSibling, getPublicId, getStylesheet, getStylesheetComposed, getStylesheetRoot, getSystemId, getTagName, getUid, getXmlSpace, getXSLToken, hasChildNodes, isCompiledTemplate, item, removeChild, replaceChild, resolvePrefixTables, runtimeInit, setDOMBackPointer, setLocaterInfo, setPrefixes, setPrefixes, setUid, setXmlSpace, shouldStripWhiteSpace
 
Methods inherited from class org.apache.xml.utils.UnImplNode
appendData, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, error, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getLocalName, getNamespaceURI, getNodeValue, getOwnerElement, getPrefix, getSpecified, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertBefore, insertData, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceData, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setNodeValue, setPrefix, setValue, splitText, substringData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

S_KEY_INDENT_AMOUNT

public static java.lang.String S_KEY_INDENT_AMOUNT
The number of whitespaces to indent by, if indent="yes".

S_KEY_CONTENT_HANDLER

public static java.lang.String S_KEY_CONTENT_HANDLER
Fully qualified name of class with a default constructor that implements the ContentHandler interface, where the result tree events will be sent to.

S_KEY_ENTITIES

public static java.lang.String S_KEY_ENTITIES
File name of file that specifies character to entity reference mappings.

S_USE_URL_ESCAPING

public static java.lang.String S_USE_URL_ESCAPING
Use a value of "yes" if the href values for HTML serialization should use %xx escaping.
Constructor Detail

OutputProperties

public OutputProperties()
Creates an empty OutputProperties with no default values.

OutputProperties

public OutputProperties(java.util.Properties defaults)
Creates an empty OutputProperties with the specified defaults.
Parameters:
defaults - the defaults.

OutputProperties

public OutputProperties(java.lang.String method)
Creates an empty OutputProperties with the defaults specified by a property file. The method argument is used to construct a string of the form output_[method].properties (for instance, output_html.properties). The output_xml.properties file is always used as the base.

At the moment, anything other than 'text', 'xml', and 'html', will use the output_xml.properties file.

Parameters:
method - non-null reference to method name.
Method Detail

getDefaultMethodProperties

public static java.util.Properties getDefaultMethodProperties(java.lang.String method)
Creates an empty OutputProperties with the defaults specified by a property file. The method argument is used to construct a string of the form output_[method].properties (for instance, output_html.properties). The output_xml.properties file is always used as the base.

At the moment, anything other than 'text', 'xml', and 'html', will use the output_xml.properties file.

Parameters:
method - non-null reference to method name.
Returns:
Properties object that holds the defaults for the given method.

clone

public java.lang.Object clone()
Clone this OutputProperties, including a clone of the wrapped Properties reference.
Returns:
A new OutputProperties reference, mutation of which should not effect this object.

setProperty

public void setProperty(QName key,
                        java.lang.String value)
Set an output property.
Parameters:
key - the key to be placed into the property list.
value - the value corresponding to key.
See Also:
OutputKeys

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Set an output property.
Parameters:
key - the key to be placed into the property list.
value - the value corresponding to key.
See Also:
OutputKeys

getProperty

public java.lang.String getProperty(QName key)
Searches for the property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
key - the property key.
Returns:
the value in this property list with the specified key value.

getProperty

public java.lang.String getProperty(java.lang.String key)
Searches for the property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
key - the property key.
Returns:
the value in this property list with the specified key value.

setBooleanProperty

public void setBooleanProperty(QName key,
                               boolean value)
Set an output property.
Parameters:
key - the key to be placed into the property list.
value - the value corresponding to key.
See Also:
OutputKeys

setBooleanProperty

public void setBooleanProperty(java.lang.String key,
                               boolean value)
Set an output property.
Parameters:
key - the key to be placed into the property list.
value - the value corresponding to key.
See Also:
OutputKeys

getBooleanProperty

public boolean getBooleanProperty(QName key)
Searches for the boolean property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns false if the property is not found, or if the value is other than "yes".
Parameters:
key - the property key.
Returns:
the value in this property list as a boolean value, or false if null or not "yes".

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key)
Searches for the boolean property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns false if the property is not found, or if the value is other than "yes".
Parameters:
key - the property key.
Returns:
the value in this property list as a boolean value, or false if null or not "yes".

getBooleanProperty

public static boolean getBooleanProperty(java.lang.String key,
                                         java.util.Properties props)
Searches for the boolean property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns false if the property is not found, or if the value is other than "yes".
Parameters:
key - the property key.
props - the list of properties that will be searched.
Returns:
the value in this property list as a boolean value, or false if null or not "yes".

setIntProperty

public void setIntProperty(QName key,
                           int value)
Set an output property.
Parameters:
key - the key to be placed into the property list.
value - the value corresponding to key.
See Also:
OutputKeys

setIntProperty

public void setIntProperty(java.lang.String key,
                           int value)
Set an output property.
Parameters:
key - the key to be placed into the property list.
value - the value corresponding to key.
See Also:
OutputKeys

getIntProperty

public int getIntProperty(QName key)
Searches for the int property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns false if the property is not found, or if the value is other than "yes".
Parameters:
key - the property key.
Returns:
the value in this property list as a int value, or false if null or not a number.

getIntProperty

public int getIntProperty(java.lang.String key)
Searches for the int property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns false if the property is not found, or if the value is other than "yes".
Parameters:
key - the property key.
Returns:
the value in this property list as a int value, or false if null or not a number.

getIntProperty

public static int getIntProperty(java.lang.String key,
                                 java.util.Properties props)
Searches for the int property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns false if the property is not found, or if the value is other than "yes".
Parameters:
key - the property key.
props - the list of properties that will be searched.
Returns:
the value in this property list as a int value, or 0 if null or not a number.

setQNameProperty

public void setQNameProperty(QName key,
                             QName value)
Set an output property with a QName value. The QName will be turned into a string with the namespace in curly brackets.
Parameters:
key - the key to be placed into the property list.
value - the value corresponding to key.
See Also:
OutputKeys

setMethodDefaults

public void setMethodDefaults(java.lang.String method)
Reset the default properties based on the method.
Parameters:
method - the method value.
See Also:
OutputKeys

setQNameProperty

public void setQNameProperty(java.lang.String key,
                             QName value)
Set an output property with a QName value. The QName will be turned into a string with the namespace in curly brackets.
Parameters:
key - the key to be placed into the property list.
value - the value corresponding to key.
See Also:
OutputKeys

getQNameProperty

public QName getQNameProperty(QName key)
Searches for the qname property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
key - the property key.
Returns:
the value in this property list as a QName value, or false if null or not "yes".

getQNameProperty

public QName getQNameProperty(java.lang.String key)
Searches for the qname property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
key - the property key.
Returns:
the value in this property list as a QName value, or false if null or not "yes".

getQNameProperty

public static QName getQNameProperty(java.lang.String key,
                                     java.util.Properties props)
Searches for the qname property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
key - the property key.
props - the list of properties to search in.
Returns:
the value in this property list as a QName value, or false if null or not "yes".

setQNameProperties

public void setQNameProperties(QName key,
                               java.util.Vector v)
Set an output property with a QName list value. The QNames will be turned into strings with the namespace in curly brackets.
Parameters:
key - the key to be placed into the property list.
v - non-null list of QNames corresponding to key.
See Also:
OutputKeys

setQNameProperties

public void setQNameProperties(java.lang.String key,
                               java.util.Vector v)
Set an output property with a QName list value. The QNames will be turned into strings with the namespace in curly brackets.
Parameters:
key - the key to be placed into the property list.
v - non-null list of QNames corresponding to key.
See Also:
OutputKeys

getQNameProperties

public java.util.Vector getQNameProperties(QName key)
Searches for the list of qname properties with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
key - the property key.
Returns:
the value in this property list as a vector of QNames, or false if null or not "yes".

getQNameProperties

public java.util.Vector getQNameProperties(java.lang.String key)
Searches for the list of qname properties with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
key - the property key.
Returns:
the value in this property list as a vector of QNames, or false if null or not "yes".

getQNameProperties

public static java.util.Vector getQNameProperties(java.lang.String key,
                                                  java.util.Properties props)
Searches for the list of qname properties with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.
Parameters:
key - the property key.
props - the list of properties to search in.
Returns:
the value in this property list as a vector of QNames, or false if null or not "yes".

recompose

public void recompose(StylesheetRoot root)
               throws TransformerException
This function is called to recompose all of the output format extended elements.
Parameters:
root - non-null reference to the stylesheet root object.
Overrides:
recompose in class ElemTemplateElement

compose

public void compose()
This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition.
Overrides:
compose in class ElemTemplateElement

getProperties

public java.util.Properties getProperties()
Get the Properties object that this class wraps.
Returns:
non-null reference to Properties object.

copyFrom

public void copyFrom(java.util.Properties src)
Copy the keys and values from the source to this object. This will not copy the default values. This is meant to be used by going from a higher precedence object to a lower precedence object, so that if a key already exists, this method will not reset it.
Parameters:
src - non-null reference to the source properties.

copyFrom

public void copyFrom(java.util.Properties src,
                     boolean shouldResetDefaults)
Copy the keys and values from the source to this object. This will not copy the default values. This is meant to be used by going from a higher precedence object to a lower precedence object, so that if a key already exists, this method will not reset it.
Parameters:
src - non-null reference to the source properties.
shouldResetDefaults - true if the defaults should be reset based on the method property.

copyFrom

public void copyFrom(OutputProperties opsrc)
              throws TransformerException
Copy the keys and values from the source to this object. This will not copy the default values. This is meant to be used by going from a higher precedence object to a lower precedence object, so that if a key already exists, this method will not reset it.
Parameters:
opsrc - non-null reference to an OutputProperties.

isLegalPropertyKey

public boolean isLegalPropertyKey(java.lang.String key)
Report if the key given as an argument is a legal xsl:output key.
Parameters:
key - non-null reference to key name.
Returns:
true if key is legal.


Copyright � 2000 Apache XML Project. All Rights Reserved.