Package org.apache.struts2.result.xslt
Class SimpleAdapterDocument
java.lang.Object
org.apache.struts2.result.xslt.AbstractAdapterNode
org.apache.struts2.result.xslt.SimpleAdapterDocument
- All Implemented Interfaces:
AdapterNode
,Document
,Node
SimpleAdapterDocument adapted a Java object and presents it as
a Document. This class represents the Document container and uses
the AdapterFactory to produce a child adapter for the wrapped object.
The adapter produced must be of an Element type or an exception is thrown.
Note: in theory we could base this on AbstractAdapterElement and then allow the wrapped object to be a more general Node type. We would just use ourselves as the root element. However I don't think this is an issue as people expect Documents to wrap Elements.
-
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
ConstructorsConstructorDescriptionSimpleAdapterDocument
(AdapterFactory adapterFactory, AdapterNode parent, String propertyName, Object value) -
Method Summary
Modifier and TypeMethodDescriptioncreateAttribute
(String string) createAttributeNS
(String string, String string1) createCDATASection
(String string) createComment
(String string) createElement
(String string) createElementNS
(String string, String string1) createEntityReference
(String string) createProcessingInstruction
(String string, String string1) createTextNode
(String string) Lazily initialize child adaptersgetChildAfter
(Node child) The child node after the specified siblinggetChildBefore
(Node child) The child node before the specified siblinggetElementById
(String string) getElementsByTagName
(String string) getElementsByTagNameNS
(String string, String string1) short
boolean
boolean
boolean
importNode
(Node node, boolean b) void
renameNode
(Node node, String string, String string1) void
setDocumentURI
(String string) void
setPropertyValue
(Object prop) void
setStrictErrorChecking
(boolean b) void
setXmlStandalone
(boolean b) void
setXmlVersion
(String string) Methods inherited from class org.apache.struts2.result.xslt.AbstractAdapterNode
appendChild, buildChildAdapters, cloneNode, compareDocumentPosition, getAdapterFactory, getAttributes, getBaseURI, getChildBeforeOrAfter, getFeature, 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, setTextContent, setUserData, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getFeature, 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
-
SimpleAdapterDocument
public SimpleAdapterDocument(AdapterFactory adapterFactory, AdapterNode parent, String propertyName, Object value)
-
-
Method Details
-
setPropertyValue
- Specified by:
setPropertyValue
in interfaceAdapterNode
- Overrides:
setPropertyValue
in classAbstractAdapterNode
- Parameters:
prop
- the Java object (property) that we are adapting
-
getChildAdapters
Description copied from class:AbstractAdapterNode
Lazily initialize child adapters- Overrides:
getChildAdapters
in classAbstractAdapterNode
- Returns:
- node list
-
getChildNodes
- Specified by:
getChildNodes
in interfaceNode
- Overrides:
getChildNodes
in classAbstractAdapterNode
-
getDoctype
- Specified by:
getDoctype
in interfaceDocument
-
getDocumentElement
- Specified by:
getDocumentElement
in interfaceDocument
-
getElementById
- Specified by:
getElementById
in interfaceDocument
-
getElementsByTagName
- Specified by:
getElementsByTagName
in interfaceDocument
- Overrides:
getElementsByTagName
in classAbstractAdapterNode
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNS
in interfaceDocument
- Overrides:
getElementsByTagNameNS
in classAbstractAdapterNode
-
getFirstChild
- Specified by:
getFirstChild
in interfaceNode
- Overrides:
getFirstChild
in classAbstractAdapterNode
-
getImplementation
- Specified by:
getImplementation
in interfaceDocument
-
getLastChild
- Specified by:
getLastChild
in interfaceNode
- Overrides:
getLastChild
in classAbstractAdapterNode
-
getNodeName
- Specified by:
getNodeName
in interfaceNode
- Overrides:
getNodeName
in classAbstractAdapterNode
-
getNodeType
public short getNodeType()- Specified by:
getNodeType
in interfaceNode
- Overrides:
getNodeType
in classAbstractAdapterNode
-
createAttribute
- Specified by:
createAttribute
in interfaceDocument
- Throws:
DOMException
-
createAttributeNS
- Specified by:
createAttributeNS
in interfaceDocument
- Throws:
DOMException
-
createCDATASection
- Specified by:
createCDATASection
in interfaceDocument
- Throws:
DOMException
-
createComment
- Specified by:
createComment
in interfaceDocument
-
createDocumentFragment
- Specified by:
createDocumentFragment
in interfaceDocument
-
createElement
- Specified by:
createElement
in interfaceDocument
- Throws:
DOMException
-
createElementNS
- Specified by:
createElementNS
in interfaceDocument
- Throws:
DOMException
-
createEntityReference
- Specified by:
createEntityReference
in interfaceDocument
- Throws:
DOMException
-
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(String string, String string1) throws DOMException - Specified by:
createProcessingInstruction
in interfaceDocument
- Throws:
DOMException
-
createTextNode
- Specified by:
createTextNode
in interfaceDocument
-
hasChildNodes
public boolean hasChildNodes()- Specified by:
hasChildNodes
in interfaceNode
- Overrides:
hasChildNodes
in classAbstractAdapterNode
-
importNode
- Specified by:
importNode
in interfaceDocument
- Throws:
DOMException
-
getChildAfter
Description copied from interface:AdapterNode
The child node after the specified sibling- Specified by:
getChildAfter
in interfaceAdapterNode
- Overrides:
getChildAfter
in classAbstractAdapterNode
- Parameters:
child
- this node- Returns:
- the child node after
-
getChildBefore
Description copied from interface:AdapterNode
The child node before the specified sibling- Specified by:
getChildBefore
in interfaceAdapterNode
- Overrides:
getChildBefore
in classAbstractAdapterNode
- Parameters:
child
- this node- Returns:
- the child node before
-
getInputEncoding
- Specified by:
getInputEncoding
in interfaceDocument
-
getXmlEncoding
- Specified by:
getXmlEncoding
in interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalone
in interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalone
in interfaceDocument
- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersion
in interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersion
in interfaceDocument
- Throws:
DOMException
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorChecking
in interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean b) - Specified by:
setStrictErrorChecking
in interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURI
in interfaceDocument
-
setDocumentURI
- Specified by:
setDocumentURI
in interfaceDocument
-
adoptNode
- Specified by:
adoptNode
in interfaceDocument
- Throws:
DOMException
-
getDomConfig
- Specified by:
getDomConfig
in interfaceDocument
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocument
in interfaceDocument
-
renameNode
- Specified by:
renameNode
in interfaceDocument
- Throws:
DOMException
-