Package org.apache.struts2.result.xslt
Class StringAdapter
java.lang.Object
org.apache.struts2.result.xslt.AbstractAdapterNode
org.apache.struts2.result.xslt.AbstractAdapterElement
org.apache.struts2.result.xslt.StringAdapter
- All Implemented Interfaces:
AdapterNode,Element,Node
StringAdapter adapts a Java String value to a DOM Element with the specified
property name containing the String's text.
e.g. a property String getFoo() { return "My Text!"; }
will appear in the result DOM as:
<foo>MyText!</foo>
Subclasses may override the getStringValue() method in order to use StringAdapter as a simplified custom XML adapter for Java types.
-
Field Summary
Fields 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
ConstructorsConstructorDescriptionStringAdapter(AdapterFactory adapterFactory, AdapterNode parent, String propertyName, String value) -
Method Summary
Modifier and TypeMethodDescriptionsubclasses override to produce their childrenbooleanDeprecated, for removal: This API element is subject to removal in a future version.This feature has been removed for security reasons (potential XML Entity Expansion attacks).protected StringGet the object to be adapted as a String value.voidsetParseStringAsXML(boolean parseStringAsXML) Deprecated, for removal: This API element is subject to removal in a future version.This feature has been removed for security reasons (potential XML Entity Expansion attacks).Methods inherited from class org.apache.struts2.result.xslt.AbstractAdapterElement
buildAttributeAdapters, getAttribute, getAttributeAdapters, getAttributeNode, getAttributeNodeNS, getAttributeNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, hasChildNodes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNSMethods inherited from class org.apache.struts2.result.xslt.AbstractAdapterNode
appendChild, cloneNode, compareDocumentPosition, getAdapterFactory, getAttributes, getBaseURI, getChildAdapters, getChildAfter, getChildBefore, getChildBeforeOrAfter, getChildNodes, getElementsByTagName, getElementsByTagNameNS, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParent, getParentNode, getPrefix, getPreviousSibling, getPropertyName, getPropertyValue, getTextContent, getUserData, hasAttributes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, operationNotSupported, removeChild, replaceChild, setAdapterFactory, setContext, setNodeValue, setParent, setPrefix, setPropertyName, setPropertyValue, setTextContent, setUserData, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.Element
getElementsByTagName, getElementsByTagNameNSMethods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Constructor Details
-
StringAdapter
public StringAdapter() -
StringAdapter
public StringAdapter(AdapterFactory adapterFactory, AdapterNode parent, String propertyName, String value)
-
-
Method Details
-
getStringValue
Get the object to be adapted as a String value.This method can be overridden by subclasses that wish to use StringAdapter as a simplified customizable XML adapter for Java types.
- Returns:
- the string value
-
buildChildAdapters
Description copied from class:AbstractAdapterNodesubclasses override to produce their children- Overrides:
buildChildAdaptersin classAbstractAdapterNode- Returns:
- List of child adapters.
-
getParseStringAsXML
Deprecated, for removal: This API element is subject to removal in a future version.This feature has been removed for security reasons (potential XML Entity Expansion attacks). This method now always returns false and will be removed in a future version.- Returns:
- always returns false
-
setParseStringAsXML
@Deprecated(forRemoval=true, since="7.2.0") public void setParseStringAsXML(boolean parseStringAsXML) Deprecated, for removal: This API element is subject to removal in a future version.This feature has been removed for security reasons (potential XML Entity Expansion attacks). This method is now a no-op and will be removed in a future version.- Parameters:
parseStringAsXML- ignored
-