Package org.apache.xalan.templates
Class OutputProperties
java.lang.Object
org.apache.xml.utils.UnImplNode
org.apache.xalan.templates.ElemTemplateElement
org.apache.xalan.templates.OutputProperties
- All Implemented Interfaces:
Serializable,Cloneable,SourceLocator,XSLTVisitable,PrefixResolver,ExpressionNode,WhitespaceStrippingElementMatcher,Document,Element,Node,NodeList
public class OutputProperties extends ElemTemplateElement implements 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
Fields inherited from class org.apache.xalan.templates.ElemTemplateElement
m_docOrderNumber, m_hasVariableDecl, m_parentNodeFields inherited from class org.apache.xml.utils.UnImplNode
actualEncoding, fDocumentURIFields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
Constructors Constructor Description OutputProperties()Creates an empty OutputProperties with no default values.OutputProperties(String method)Creates an empty OutputProperties with the defaults specified by a property file.OutputProperties(Properties defaults)Creates an empty OutputProperties with the specified defaults. -
Method Summary
Modifier and Type Method Description Objectclone()Clone this OutputProperties, including a clone of the wrapped Properties reference.voidcompose(StylesheetRoot sroot)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.voidcopyFrom(Properties src)Copy the keys and values from the source to this object.voidcopyFrom(Properties src, boolean shouldResetDefaults)Copy the keys and values from the source to this object.voidcopyFrom(OutputProperties opsrc)Copy the keys and values from the source to this object.booleangetBooleanProperty(String key)Searches for the boolean property with the specified key in the property list.booleangetBooleanProperty(QName key)Searches for the boolean property with the specified key in the property list.static PropertiesgetDefaultMethodProperties(String method)Deprecated.Use org.apache.xml.serializer.OuputPropertiesFactory.intgetIntProperty(String key)Searches for the int property with the specified key in the property list.intgetIntProperty(QName key)Searches for the int property with the specified key in the property list.PropertiesgetProperties()Get the Properties object that this class wraps.StringgetProperty(String key)Searches for the property with the specified key in the property list.StringgetProperty(QName key)Searches for the property with the specified key in the property list.VectorgetQNameProperties(String key)Searches for the list of qname properties with the specified key in the property list.static VectorgetQNameProperties(String key, Properties props)Searches for the list of qname properties with the specified key in the property list.VectorgetQNameProperties(QName key)Searches for the list of qname properties with the specified key in the property list.QNamegetQNameProperty(String key)Searches for the qname property with the specified key in the property list.static QNamegetQNameProperty(String key, Properties props)Searches for the qname property with the specified key in the property list.QNamegetQNameProperty(QName key)Searches for the qname property with the specified key in the property list.static booleanisLegalPropertyKey(String key)Report if the key given as an argument is a legal xsl:output key.voidrecompose(StylesheetRoot root)This function is called to recompose all of the output format extended elements.voidsetBooleanProperty(String key, boolean value)Set an output property.voidsetBooleanProperty(QName key, boolean value)Set an output property.voidsetIntProperty(String key, int value)Set an output property.voidsetIntProperty(QName key, int value)Set an output property.voidsetMethodDefaults(String method)Reset the default properties based on the method.voidsetProperty(String key, String value)Set an output property.voidsetProperty(QName key, String value)Set an output property.voidsetQNameProperties(String key, Vector v)Set an output property with a QName list value.voidsetQNameProperties(QName key, Vector v)Set an output property with a QName list value.voidsetQNameProperty(String key, QName value)Set an output property with a QName value.voidsetQNameProperty(QName key, QName value)Set an output property with a QName value.Methods inherited from class org.apache.xalan.templates.ElemTemplateElement
accept, appendChild, appendChild, callChildVisitors, callChildVisitors, callVisitors, canAcceptVariables, canStripWhiteSpace, compareTo, containsExcludeResultPrefix, endCompose, error, error, execute, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getBaseIdentifier, getChildNodes, getColumnNumber, getDeclaredPrefixes, getDOMBackPointer, getEndColumnNumber, getEndLineNumber, getFirstChild, getFirstChildElem, getLastChild, getLastChildElem, getLength, getLineNumber, getLocalName, getNamespaceForPrefix, getNamespaceForPrefix, getNextSibling, getNextSiblingElem, getNodeName, getNodeType, getOwnerDocument, getOwnerXSLTemplate, getParentElem, getParentNode, getParentNodeElem, getPreviousSibling, getPreviousSiblingElem, getPublicId, getStylesheet, getStylesheetComposed, getStylesheetRoot, getSystemId, getTagName, getUid, getXmlSpace, getXSLToken, handlesNullPrefixes, hasChildNodes, hasTextLitOnly, hasVariableDecl, insertBefore, isCompiledTemplate, item, removeChild, replaceChild, replaceChild, resolvePrefixTables, runtimeInit, setDOMBackPointer, setEndLocaterInfo, setLocaterInfo, setParentElem, setPrefixes, setPrefixes, setUid, setXmlSpace, shouldStripWhiteSpaceMethods inherited from class org.apache.xml.utils.UnImplNode
adoptNode, appendData, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, getActualEncoding, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getInputEncoding, getNamespaceURI, getNodeValue, getOwnerElement, getPrefix, getSchemaTypeInfo, getSpecified, getStrictErrorChecking, getTextContent, getUserData, getWholeText, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertData, isDefaultNamespace, isEqualNode, isId, isSameNode, isSupported, isWhitespaceInElementContent, lookupNamespaceURI, lookupPrefix, normalize, normalizeDocument, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, renameNode, replaceData, replaceWholeText, setActualEncoding, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setDocumentURI, setIdAttribute, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setInputEncoding, setNodeValue, setPrefix, setStrictErrorChecking, setTextContent, setUserData, setValue, setXmlEncoding, setXmlStandalone, setXmlVersion, splitText, substringData
-
Constructor Details
-
OutputProperties
public OutputProperties()Creates an empty OutputProperties with no default values. -
OutputProperties
Creates an empty OutputProperties with the specified defaults.- Parameters:
defaults- the defaults.
-
OutputProperties
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 Details
-
clone
Clone this OutputProperties, including a clone of the wrapped Properties reference. -
setProperty
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
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
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 returnsnullif the property is not found.- Parameters:
key- the property key.- Returns:
- the value in this property list with the specified key value.
-
getProperty
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 returnsnullif the property is not found.- Parameters:
key- the property key.- Returns:
- the value in this property list with the specified key value.
-
setBooleanProperty
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
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
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 returnsfalseif 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
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 returnsfalseif 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".
-
setIntProperty
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
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
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 returnsfalseif 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
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 returnsfalseif 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.
-
setQNameProperty
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
Reset the default properties based on the method.- Parameters:
method- the method value.- See Also:
OutputKeys
-
setQNameProperty
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
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 returnsnullif 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
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 returnsnullif 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
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 returnsnullif 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
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
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
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 returnsnullif 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
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 returnsnullif 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
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 returnsnullif 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
This function is called to recompose all of the output format extended elements.- Overrides:
recomposein classElemTemplateElement- Parameters:
root- non-null reference to the stylesheet root object.- Throws:
TransformerException
-
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:
composein classElemTemplateElement- Throws:
TransformerException
-
getProperties
Get the Properties object that this class wraps.- Returns:
- non-null reference to Properties object.
-
copyFrom
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
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
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.- Throws:
TransformerException
-
isLegalPropertyKey
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.
-
getDefaultMethodProperties
Deprecated.Use org.apache.xml.serializer.OuputPropertiesFactory. getDefaultMethodProperties directly.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.
-