org.apache.struts2.views.xslt
Class SimpleAdapterDocument

java.lang.Object
  extended by org.apache.struts2.views.xslt.AbstractAdapterNode
      extended by org.apache.struts2.views.xslt.SimpleAdapterDocument
All Implemented Interfaces:
AdapterNode, org.w3c.dom.Document, org.w3c.dom.Node

public class SimpleAdapterDocument
extends AbstractAdapterNode
implements org.w3c.dom.Document

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
SimpleAdapterDocument(AdapterFactory adapterFactory, AdapterNode parent, java.lang.String propertyName, java.lang.Object value)
           
 
Method Summary
 org.w3c.dom.Node adoptNode(org.w3c.dom.Node node)
           
 org.w3c.dom.Attr createAttribute(java.lang.String string)
           
 org.w3c.dom.Attr createAttributeNS(java.lang.String string, java.lang.String string1)
           
 org.w3c.dom.CDATASection createCDATASection(java.lang.String string)
           
 org.w3c.dom.Comment createComment(java.lang.String string)
           
 org.w3c.dom.DocumentFragment createDocumentFragment()
           
 org.w3c.dom.Element createElement(java.lang.String string)
           
 org.w3c.dom.Element createElementNS(java.lang.String string, java.lang.String string1)
           
 org.w3c.dom.EntityReference createEntityReference(java.lang.String string)
           
 org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String string, java.lang.String string1)
           
 org.w3c.dom.Text createTextNode(java.lang.String string)
           
protected  java.util.List<org.w3c.dom.Node> getChildAdapters()
          Lazily initialize child childAdapters
 org.w3c.dom.Node getChildAfter(org.w3c.dom.Node child)
          The child node after the specified sibling
 org.w3c.dom.Node getChildBefore(org.w3c.dom.Node child)
          The child node before the specified sibling
 org.w3c.dom.NodeList getChildNodes()
           
 org.w3c.dom.DocumentType getDoctype()
           
 org.w3c.dom.Element getDocumentElement()
           
 java.lang.String getDocumentURI()
           
 org.w3c.dom.DOMConfiguration getDomConfig()
           
 org.w3c.dom.Element getElementById(java.lang.String string)
           
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String string)
           
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String string, java.lang.String string1)
           
 org.w3c.dom.Node getFirstChild()
           
 org.w3c.dom.DOMImplementation getImplementation()
           
 java.lang.String getInputEncoding()
           
 org.w3c.dom.Node getLastChild()
           
 java.lang.String getNodeName()
           
 short getNodeType()
           
 boolean getStrictErrorChecking()
           
 java.lang.String getXmlEncoding()
           
 boolean getXmlStandalone()
           
 java.lang.String getXmlVersion()
           
 boolean hasChildNodes()
           
 org.w3c.dom.Node importNode(org.w3c.dom.Node node, boolean b)
           
 void normalizeDocument()
           
 org.w3c.dom.Node renameNode(org.w3c.dom.Node node, java.lang.String string, java.lang.String string1)
           
 void setDocumentURI(java.lang.String string)
           
 void setPropertyValue(java.lang.Object prop)
          The Java object (property) that we are adapting
 void setStrictErrorChecking(boolean b)
           
 void setXmlStandalone(boolean b)
           
 void setXmlVersion(java.lang.String string)
           
 
Methods inherited from class org.apache.struts2.views.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 Detail

SimpleAdapterDocument

public SimpleAdapterDocument(AdapterFactory adapterFactory,
                             AdapterNode parent,
                             java.lang.String propertyName,
                             java.lang.Object value)
Method Detail

setPropertyValue

public void setPropertyValue(java.lang.Object prop)
Description copied from interface: AdapterNode
The Java object (property) that we are adapting

Specified by:
setPropertyValue in interface AdapterNode
Overrides:
setPropertyValue in class AbstractAdapterNode

getChildAdapters

protected java.util.List<org.w3c.dom.Node> getChildAdapters()
Description copied from class: AbstractAdapterNode
Lazily initialize child childAdapters

Overrides:
getChildAdapters in class AbstractAdapterNode

getChildNodes

public org.w3c.dom.NodeList getChildNodes()
Specified by:
getChildNodes in interface org.w3c.dom.Node
Overrides:
getChildNodes in class AbstractAdapterNode

getDoctype

public org.w3c.dom.DocumentType getDoctype()
Specified by:
getDoctype in interface org.w3c.dom.Document

getDocumentElement

public org.w3c.dom.Element getDocumentElement()
Specified by:
getDocumentElement in interface org.w3c.dom.Document

getElementById

public org.w3c.dom.Element getElementById(java.lang.String string)
Specified by:
getElementById in interface org.w3c.dom.Document

getElementsByTagName

public org.w3c.dom.NodeList getElementsByTagName(java.lang.String string)
Specified by:
getElementsByTagName in interface org.w3c.dom.Document
Overrides:
getElementsByTagName in class AbstractAdapterNode

getElementsByTagNameNS

public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String string,
                                                   java.lang.String string1)
Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Document
Overrides:
getElementsByTagNameNS in class AbstractAdapterNode

getFirstChild

public org.w3c.dom.Node getFirstChild()
Specified by:
getFirstChild in interface org.w3c.dom.Node
Overrides:
getFirstChild in class AbstractAdapterNode

getImplementation

public org.w3c.dom.DOMImplementation getImplementation()
Specified by:
getImplementation in interface org.w3c.dom.Document

getLastChild

public org.w3c.dom.Node getLastChild()
Specified by:
getLastChild in interface org.w3c.dom.Node
Overrides:
getLastChild in class AbstractAdapterNode

getNodeName

public java.lang.String getNodeName()
Specified by:
getNodeName in interface org.w3c.dom.Node
Overrides:
getNodeName in class AbstractAdapterNode

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface org.w3c.dom.Node
Overrides:
getNodeType in class AbstractAdapterNode

createAttribute

public org.w3c.dom.Attr createAttribute(java.lang.String string)
                                 throws org.w3c.dom.DOMException
Specified by:
createAttribute in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createAttributeNS

public org.w3c.dom.Attr createAttributeNS(java.lang.String string,
                                          java.lang.String string1)
                                   throws org.w3c.dom.DOMException
Specified by:
createAttributeNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createCDATASection

public org.w3c.dom.CDATASection createCDATASection(java.lang.String string)
                                            throws org.w3c.dom.DOMException
Specified by:
createCDATASection in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createComment

public org.w3c.dom.Comment createComment(java.lang.String string)
Specified by:
createComment in interface org.w3c.dom.Document

createDocumentFragment

public org.w3c.dom.DocumentFragment createDocumentFragment()
Specified by:
createDocumentFragment in interface org.w3c.dom.Document

createElement

public org.w3c.dom.Element createElement(java.lang.String string)
                                  throws org.w3c.dom.DOMException
Specified by:
createElement in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createElementNS

public org.w3c.dom.Element createElementNS(java.lang.String string,
                                           java.lang.String string1)
                                    throws org.w3c.dom.DOMException
Specified by:
createElementNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createEntityReference

public org.w3c.dom.EntityReference createEntityReference(java.lang.String string)
                                                  throws org.w3c.dom.DOMException
Specified by:
createEntityReference in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createProcessingInstruction

public org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String string,
                                                                     java.lang.String string1)
                                                              throws org.w3c.dom.DOMException
Specified by:
createProcessingInstruction in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createTextNode

public org.w3c.dom.Text createTextNode(java.lang.String string)
Specified by:
createTextNode in interface org.w3c.dom.Document

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface org.w3c.dom.Node
Overrides:
hasChildNodes in class AbstractAdapterNode

importNode

public org.w3c.dom.Node importNode(org.w3c.dom.Node node,
                                   boolean b)
                            throws org.w3c.dom.DOMException
Specified by:
importNode in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

getChildAfter

public org.w3c.dom.Node getChildAfter(org.w3c.dom.Node child)
Description copied from interface: AdapterNode
The child node after the specified sibling

Specified by:
getChildAfter in interface AdapterNode
Overrides:
getChildAfter in class AbstractAdapterNode

getChildBefore

public org.w3c.dom.Node getChildBefore(org.w3c.dom.Node child)
Description copied from interface: AdapterNode
The child node before the specified sibling

Specified by:
getChildBefore in interface AdapterNode
Overrides:
getChildBefore in class AbstractAdapterNode

getInputEncoding

public java.lang.String getInputEncoding()
Specified by:
getInputEncoding in interface org.w3c.dom.Document

getXmlEncoding

public java.lang.String getXmlEncoding()
Specified by:
getXmlEncoding in interface org.w3c.dom.Document

getXmlStandalone

public boolean getXmlStandalone()
Specified by:
getXmlStandalone in interface org.w3c.dom.Document

setXmlStandalone

public void setXmlStandalone(boolean b)
                      throws org.w3c.dom.DOMException
Specified by:
setXmlStandalone in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

getXmlVersion

public java.lang.String getXmlVersion()
Specified by:
getXmlVersion in interface org.w3c.dom.Document

setXmlVersion

public void setXmlVersion(java.lang.String string)
                   throws org.w3c.dom.DOMException
Specified by:
setXmlVersion in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

getStrictErrorChecking

public boolean getStrictErrorChecking()
Specified by:
getStrictErrorChecking in interface org.w3c.dom.Document

setStrictErrorChecking

public void setStrictErrorChecking(boolean b)
Specified by:
setStrictErrorChecking in interface org.w3c.dom.Document

getDocumentURI

public java.lang.String getDocumentURI()
Specified by:
getDocumentURI in interface org.w3c.dom.Document

setDocumentURI

public void setDocumentURI(java.lang.String string)
Specified by:
setDocumentURI in interface org.w3c.dom.Document

adoptNode

public org.w3c.dom.Node adoptNode(org.w3c.dom.Node node)
                           throws org.w3c.dom.DOMException
Specified by:
adoptNode in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

getDomConfig

public org.w3c.dom.DOMConfiguration getDomConfig()
Specified by:
getDomConfig in interface org.w3c.dom.Document

normalizeDocument

public void normalizeDocument()
Specified by:
normalizeDocument in interface org.w3c.dom.Document

renameNode

public org.w3c.dom.Node renameNode(org.w3c.dom.Node node,
                                   java.lang.String string,
                                   java.lang.String string1)
                            throws org.w3c.dom.DOMException
Specified by:
renameNode in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.