org.apache.cocoon.components.jxdom
Class DocumentAdapter

java.lang.Object
  extended byorg.apache.cocoon.components.jxdom.DocumentAdapter
All Implemented Interfaces:
Document, Node

public class DocumentAdapter
extends Object
implements Document

DOM Wrapper for Java Beans and JavaScript objects utilizing Apache JXPath's Introspector.

Version:
SVN $ID:$

Nested Class Summary
 class DocumentAdapter.ElementAdapter
           
 class DocumentAdapter.NodeAdapter
           
 class DocumentAdapter.TextAdapter
           
 
Field Summary
protected static String DOMLEVEL3_ERR_MSG
           
protected static NodeList EMPTY_NODE_LIST
           
protected static NamedNodeMap EMPTY_NODE_MAP
           
protected static org.apache.commons.jxpath.CompiledExpression GET_CHILD_NODES
           
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
DocumentAdapter(Object obj, String tagName)
           
 
Method Summary
 Node adoptNode(Node source)
           
 Node appendChild(Node newChild)
           
 Node cloneNode(boolean deep)
           
 short compareDocumentPosition(Node other)
           
 Attr createAttribute(String name)
           
 Attr createAttributeNS(String namespaceURI, String qualifiedName)
           
 CDATASection createCDATASection(String data)
           
 Comment createComment(String data)
           
 DocumentFragment createDocumentFragment()
           
 Element createElement(String tagName)
           
 Element createElementNS(String namespaceURI, String qualifiedName)
           
 EntityReference createEntityReference(String name)
           
 ProcessingInstruction createProcessingInstruction(String target, String data)
           
 Text createTextNode(String data)
           
 NamedNodeMap getAttributes()
           
 String getBaseURI()
           
 NodeList getChildNodes()
           
 DocumentType getDoctype()
           
 Element getDocumentElement()
           
 String getDocumentURI()
           
 DOMConfiguration getDomConfig()
           
 Element getElementById(String elementId)
           
 NodeList getElementsByTagName(String tagname)
           
 NodeList getElementsByTagNameNS(String namespaceURI, String localName)
           
 Object getFeature(String feature, String version)
           
 Node getFirstChild()
           
 DOMImplementation getImplementation()
           
 String getInputEncoding()
           
 Node getLastChild()
           
 String getLocalName()
           
 String getNamespaceURI()
           
 Node getNextSibling()
           
 String getNodeName()
           
 short getNodeType()
           
 String getNodeValue()
           
 Document getOwnerDocument()
           
 Node getParentNode()
           
 String getPrefix()
           
 Node getPreviousSibling()
           
 boolean getStrictErrorChecking()
           
 String getTextContent()
           
 Object getUserData(String key)
           
 String getXmlEncoding()
           
 boolean getXmlStandalone()
           
 String getXmlVersion()
           
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 Node importNode(Node importedNode, boolean deep)
           
 Node insertBefore(Node newChild, Node refChild)
           
 boolean isDefaultNamespace(String namespaceURI)
           
 boolean isEqualNode(Node arg)
           
 boolean isSameNode(Node other)
           
 boolean isSupported(String feature, String version)
           
 String lookupNamespaceURI(String prefix)
           
 String lookupPrefix(String namespaceURI)
           
protected static org.apache.commons.jxpath.JXPathContext newContext(Object obj)
           
 void normalize()
           
 void normalizeDocument()
           
protected static void notSupported()
           
 Node removeChild(Node oldChild)
           
 Node renameNode(Node node, String namespaceURI, String qualifiedName)
           
 Node replaceChild(Node newChild, Node oldChild)
           
 void setDocumentURI(String uri)
           
 void setNodeValue(String nodeValue)
           
 void setPrefix(String prefix)
           
 void setStrictErrorChecking(boolean value)
           
 void setTextContent(String textContent)
           
 Object setUserData(String key, Object value, UserDataHandler handler)
           
 void setXmlEncoding(String version)
           
 void setXmlStandalone(boolean value)
           
 void setXmlVersion(String version)
           
 Object unwrap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOMLEVEL3_ERR_MSG

protected static final String DOMLEVEL3_ERR_MSG
See Also:
Constant Field Values

GET_CHILD_NODES

protected static final org.apache.commons.jxpath.CompiledExpression GET_CHILD_NODES

EMPTY_NODE_MAP

protected static final NamedNodeMap EMPTY_NODE_MAP

EMPTY_NODE_LIST

protected static final NodeList EMPTY_NODE_LIST
Constructor Detail

DocumentAdapter

public DocumentAdapter(Object obj,
                       String tagName)
Method Detail

notSupported

protected static void notSupported()
                            throws DOMException
Throws:
DOMException

newContext

protected static org.apache.commons.jxpath.JXPathContext newContext(Object obj)

getDoctype

public DocumentType getDoctype()
Specified by:
getDoctype in interface Document

getImplementation

public DOMImplementation getImplementation()
Specified by:
getImplementation in interface Document

getDocumentElement

public Element getDocumentElement()
Specified by:
getDocumentElement in interface Document

createElement

public Element createElement(String tagName)
                      throws DOMException
Specified by:
createElement in interface Document
Throws:
DOMException

createDocumentFragment

public DocumentFragment createDocumentFragment()
Specified by:
createDocumentFragment in interface Document

createTextNode

public Text createTextNode(String data)
Specified by:
createTextNode in interface Document

createComment

public Comment createComment(String data)
Specified by:
createComment in interface Document

createCDATASection

public CDATASection createCDATASection(String data)
                                throws DOMException
Specified by:
createCDATASection in interface Document
Throws:
DOMException

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(String target,
                                                         String data)
                                                  throws DOMException
Specified by:
createProcessingInstruction in interface Document
Throws:
DOMException

createAttribute

public Attr createAttribute(String name)
                     throws DOMException
Specified by:
createAttribute in interface Document
Throws:
DOMException

createEntityReference

public EntityReference createEntityReference(String name)
                                      throws DOMException
Specified by:
createEntityReference in interface Document
Throws:
DOMException

getElementsByTagName

public NodeList getElementsByTagName(String tagname)
Specified by:
getElementsByTagName in interface Document

importNode

public Node importNode(Node importedNode,
                       boolean deep)
                throws DOMException
Specified by:
importNode in interface Document
Throws:
DOMException

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName)
                        throws DOMException
Specified by:
createElementNS in interface Document
Throws:
DOMException

createAttributeNS

public Attr createAttributeNS(String namespaceURI,
                              String qualifiedName)
                       throws DOMException
Specified by:
createAttributeNS in interface Document
Throws:
DOMException

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI,
                                       String localName)
Specified by:
getElementsByTagNameNS in interface Document

getElementById

public Element getElementById(String elementId)
Specified by:
getElementById in interface Document

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface Node

getNodeValue

public String getNodeValue()
                    throws DOMException
Specified by:
getNodeValue in interface Node
Throws:
DOMException

setNodeValue

public void setNodeValue(String nodeValue)
                  throws DOMException
Specified by:
setNodeValue in interface Node
Throws:
DOMException

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface Node

getParentNode

public Node getParentNode()
Specified by:
getParentNode in interface Node

getChildNodes

public NodeList getChildNodes()
Specified by:
getChildNodes in interface Node

getFirstChild

public Node getFirstChild()
Specified by:
getFirstChild in interface Node

getLastChild

public Node getLastChild()
Specified by:
getLastChild in interface Node

getPreviousSibling

public Node getPreviousSibling()
Specified by:
getPreviousSibling in interface Node

getNextSibling

public Node getNextSibling()
Specified by:
getNextSibling in interface Node

getAttributes

public NamedNodeMap getAttributes()
Specified by:
getAttributes in interface Node

getOwnerDocument

public Document getOwnerDocument()
Specified by:
getOwnerDocument in interface Node

insertBefore

public Node insertBefore(Node newChild,
                         Node refChild)
                  throws DOMException
Specified by:
insertBefore in interface Node
Throws:
DOMException

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
                  throws DOMException
Specified by:
replaceChild in interface Node
Throws:
DOMException

removeChild

public Node removeChild(Node oldChild)
                 throws DOMException
Specified by:
removeChild in interface Node
Throws:
DOMException

appendChild

public Node appendChild(Node newChild)
                 throws DOMException
Specified by:
appendChild in interface Node
Throws:
DOMException

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface Node

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node

normalize

public void normalize()
Specified by:
normalize in interface Node

isSupported

public boolean isSupported(String feature,
                           String version)
Specified by:
isSupported in interface Node

getNamespaceURI

public String getNamespaceURI()
Specified by:
getNamespaceURI in interface Node

getPrefix

public String getPrefix()
Specified by:
getPrefix in interface Node

setPrefix

public void setPrefix(String prefix)
               throws DOMException
Specified by:
setPrefix in interface Node
Throws:
DOMException

getLocalName

public String getLocalName()
Specified by:
getLocalName in interface Node

hasAttributes

public boolean hasAttributes()
Specified by:
hasAttributes in interface Node

unwrap

public Object unwrap()

renameNode

public Node renameNode(Node node,
                       String namespaceURI,
                       String qualifiedName)
                throws DOMException
Throws:
DOMException
Since:
DOM Level 3

normalizeDocument

public void normalizeDocument()
Since:
DOM Level 3

getDomConfig

public DOMConfiguration getDomConfig()
Since:
DOM Level 3

adoptNode

public Node adoptNode(Node source)
Since:
DOM Level 3

setDocumentURI

public void setDocumentURI(String uri)
Since:
DOM Level 3

getDocumentURI

public String getDocumentURI()
Since:
DOM Level 3

setStrictErrorChecking

public void setStrictErrorChecking(boolean value)
Since:
DOM Level 3

getStrictErrorChecking

public boolean getStrictErrorChecking()
Since:
DOM Level 3

setXmlVersion

public void setXmlVersion(String version)
Since:
DOM Level 3

getXmlVersion

public String getXmlVersion()
Since:
DOM Level 3

setXmlStandalone

public void setXmlStandalone(boolean value)
Since:
DOM Level 3

getXmlStandalone

public boolean getXmlStandalone()
Since:
DOM Level 3

setXmlEncoding

public void setXmlEncoding(String version)
Since:
DOM Level 3

getXmlEncoding

public String getXmlEncoding()
Since:
DOM Level 3

getInputEncoding

public String getInputEncoding()
Since:
DOM Level 3

getUserData

public Object getUserData(String key)
Since:
DOM Level 3

setUserData

public Object setUserData(String key,
                          Object value,
                          UserDataHandler handler)
Since:
DOM Level 3

getFeature

public Object getFeature(String feature,
                         String version)
Since:
DOM Level 3

compareDocumentPosition

public short compareDocumentPosition(Node other)
                              throws DOMException
Throws:
DOMException
Since:
DOM Level 3

getBaseURI

public String getBaseURI()
Since:
DOM Level 3

getTextContent

public String getTextContent()
                      throws DOMException
Throws:
DOMException
Since:
DOM Level 3

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)
Since:
DOM Level 3

isEqualNode

public boolean isEqualNode(Node arg)
Since:
DOM Level 3

isSameNode

public boolean isSameNode(Node other)
Since:
DOM Level 3

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)
Since:
DOM Level 3

lookupPrefix

public String lookupPrefix(String namespaceURI)
Since:
DOM Level 3

setTextContent

public void setTextContent(String textContent)
                    throws DOMException
Throws:
DOMException
Since:
DOM Level 3


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.