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) shortbooleanbooleanbooleanimportNode(Node node, boolean b) voidrenameNode(Node node, String string, String string1) voidsetDocumentURI(String string) voidsetPropertyValue(Object prop) voidsetStrictErrorChecking(boolean b) voidsetXmlStandalone(boolean b) voidsetXmlVersion(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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
setPropertyValuein interfaceAdapterNode- Overrides:
setPropertyValuein classAbstractAdapterNode- Parameters:
prop- the Java object (property) that we are adapting
-
getChildAdapters
Description copied from class:AbstractAdapterNodeLazily initialize child adapters- Overrides:
getChildAdaptersin classAbstractAdapterNode- Returns:
- node list
-
getChildNodes
- Specified by:
getChildNodesin interfaceNode- Overrides:
getChildNodesin classAbstractAdapterNode
-
getDoctype
- Specified by:
getDoctypein interfaceDocument
-
getDocumentElement
- Specified by:
getDocumentElementin interfaceDocument
-
getElementById
- Specified by:
getElementByIdin interfaceDocument
-
getElementsByTagName
- Specified by:
getElementsByTagNamein interfaceDocument- Overrides:
getElementsByTagNamein classAbstractAdapterNode
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNSin interfaceDocument- Overrides:
getElementsByTagNameNSin classAbstractAdapterNode
-
getFirstChild
- Specified by:
getFirstChildin interfaceNode- Overrides:
getFirstChildin classAbstractAdapterNode
-
getImplementation
- Specified by:
getImplementationin interfaceDocument
-
getLastChild
- Specified by:
getLastChildin interfaceNode- Overrides:
getLastChildin classAbstractAdapterNode
-
getNodeName
- Specified by:
getNodeNamein interfaceNode- Overrides:
getNodeNamein classAbstractAdapterNode
-
getNodeType
public short getNodeType()- Specified by:
getNodeTypein interfaceNode- Overrides:
getNodeTypein classAbstractAdapterNode
-
createAttribute
- Specified by:
createAttributein interfaceDocument- Throws:
DOMException
-
createAttributeNS
- Specified by:
createAttributeNSin interfaceDocument- Throws:
DOMException
-
createCDATASection
- Specified by:
createCDATASectionin interfaceDocument- Throws:
DOMException
-
createComment
- Specified by:
createCommentin interfaceDocument
-
createDocumentFragment
- Specified by:
createDocumentFragmentin interfaceDocument
-
createElement
- Specified by:
createElementin interfaceDocument- Throws:
DOMException
-
createElementNS
- Specified by:
createElementNSin interfaceDocument- Throws:
DOMException
-
createEntityReference
- Specified by:
createEntityReferencein interfaceDocument- Throws:
DOMException
-
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(String string, String string1) throws DOMException - Specified by:
createProcessingInstructionin interfaceDocument- Throws:
DOMException
-
createTextNode
- Specified by:
createTextNodein interfaceDocument
-
hasChildNodes
public boolean hasChildNodes()- Specified by:
hasChildNodesin interfaceNode- Overrides:
hasChildNodesin classAbstractAdapterNode
-
importNode
- Specified by:
importNodein interfaceDocument- Throws:
DOMException
-
getChildAfter
Description copied from interface:AdapterNodeThe child node after the specified sibling- Specified by:
getChildAfterin interfaceAdapterNode- Overrides:
getChildAfterin classAbstractAdapterNode- Parameters:
child- this node- Returns:
- the child node after
-
getChildBefore
Description copied from interface:AdapterNodeThe child node before the specified sibling- Specified by:
getChildBeforein interfaceAdapterNode- Overrides:
getChildBeforein classAbstractAdapterNode- Parameters:
child- this node- Returns:
- the child node before
-
getInputEncoding
- Specified by:
getInputEncodingin interfaceDocument
-
getXmlEncoding
- Specified by:
getXmlEncodingin interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalonein interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalonein interfaceDocument- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersionin interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersionin interfaceDocument- Throws:
DOMException
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorCheckingin interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean b) - Specified by:
setStrictErrorCheckingin interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURIin interfaceDocument
-
setDocumentURI
- Specified by:
setDocumentURIin interfaceDocument
-
adoptNode
- Specified by:
adoptNodein interfaceDocument- Throws:
DOMException
-
getDomConfig
- Specified by:
getDomConfigin interfaceDocument
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocumentin interfaceDocument
-
renameNode
- Specified by:
renameNodein interfaceDocument- Throws:
DOMException
-