org.jboss.axis.message
Class SOAPDocumentImpl

java.lang.Object
  extended by org.jboss.axis.message.SOAPDocumentImpl
All Implemented Interfaces:
Document, Node

public class SOAPDocumentImpl
extends Object
implements Document

SOAPDcoumentImpl implements the Document API for SOAPPART. At the moment, it again delgate the XERCES DOM Implementation Here is my argument on it: I guess that there is 3 way to implement this. - fully implement the DOM API here myself. => This is too much and duplicated work. - extends XERCES Implementation => this makes we are fixed to one Implementation - choose delgate depends on the user's parser preference => This is the practically best solution I have now

Author:
Heejune Ahn (cityboy@tmax.co.kr)

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
SOAPDocumentImpl(MessagePart sp)
          Construct the Document
 
Method Summary
 Node adoptNode(Node source)
           
 Node appendChild(Node newChild)
           
 Node cloneNode(boolean deep)
          [todo] Study it more....
 short compareDocumentPosition(Node other)
           
 Attr createAttribute(String name)
           
 Attr createAttributeNS(String namespaceURI, String qualifiedName)
          Attribute is not particularly dealt with in SAAJ.
 CDATASection createCDATASection(String data)
          Creates a CDATASection node whose value is the specified string.
 Comment createComment(String data)
          Creates a Comment node given the specified string.
 DocumentFragment createDocumentFragment()
          Creates an empty DocumentFragment object.
 Element createElement(String tagName)
          based on the tagName, we will make different kind SOAP Elements Instance Is really we can determine the Type by the Tagname???
 Element createElementNS(String namespaceURI, String qualifiedName)
          Return SOAPElements (what if they want SOAPEnvelope or Header/Body?)
 EntityReference createEntityReference(String name)
           
 ProcessingInstruction createProcessingInstruction(String target, String data)
          Creates a ProcessingInstruction node given the specified name and data strings.
 Text createTextNode(String data)
          Creates a Text node given the specified string.
 NamedNodeMap getAttributes()
           
 String getBaseURI()
           
 NodeList getChildNodes()
           
 DocumentType getDoctype()
           
 Element getDocumentElement()
          should not be called, the method will be handled in SOAPPart
 String getDocumentURI()
           
 DOMConfiguration getDomConfig()
           
 Element getElementById(String elementId)
          Returns the Element whose ID is given by elementId.
 NodeList getElementsByTagName(String localName)
          search the SOAPPart in order of SOAPHeader and SOAPBody for the requested Element name
 NodeList getElementsByTagNameNS(String namespaceURI, String localName)
          search the SOAPPart in order of SOAPHeader and SOAPBody for the requested Element name
 Object getFeature(String feature, String version)
           
 Node getFirstChild()
          Do we have to count the Attributes as node ????
 DOMImplementation getImplementation()
           
 String getInputEncoding()
           
 Node getLastChild()
           
 String getLocalName()
           
 String getNamespaceURI()
           
 Node getNextSibling()
           
 String getNodeName()
          Node Implementation
 short getNodeType()
          override it in sub-classes
 String getNodeValue()
           
 Document getOwnerDocument()
          we have to have a link to them...
 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)
           
 void normalize()
          [todo] is it OK to simply call the superclass?
 void normalizeDocument()
           
 Node removeChild(Node oldChild)
           
 Node renameNode(Node n, String namespaceURI, String qualifiedName)
           
 Node replaceChild(Node newChild, Node oldChild)
           
 void setDocumentURI(String documentURI)
           
 void setNamespaceURI(String nsURI)
           
 void setNodeValue(String nodeValue)
           
 void setPrefix(String prefix)
           
 void setStrictErrorChecking(boolean strictErrorChecking)
           
 void setTextContent(String textContent)
           
 Object setUserData(String key, Object data, UserDataHandler handler)
           
 void setXmlStandalone(boolean xmlStandalone)
           
 void setXmlVersion(String xmlVersion)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SOAPDocumentImpl

public SOAPDocumentImpl(MessagePart sp)
Construct the Document

Parameters:
sp -
Method Detail

getDoctype

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

getImplementation

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

getDocumentElement

public Element getDocumentElement()
should not be called, the method will be handled in SOAPPart

Specified by:
getDocumentElement in interface Document
Returns:

createElement

public Element createElement(String tagName)
                      throws DOMException
based on the tagName, we will make different kind SOAP Elements Instance Is really we can determine the Type by the Tagname???

Specified by:
createElement in interface Document
Parameters:
tagName -
Returns:
@throws DOMException
Throws:
DOMException

createDocumentFragment

public DocumentFragment createDocumentFragment()
Creates an empty DocumentFragment object. @todo not implemented yet

Specified by:
createDocumentFragment in interface Document
Returns:
A new DocumentFragment.

createTextNode

public Text createTextNode(String data)
Creates a Text node given the specified string.

Specified by:
createTextNode in interface Document
Parameters:
data - The data for the node.
Returns:
The new Text object.

createComment

public Comment createComment(String data)
Creates a Comment node given the specified string.

Specified by:
createComment in interface Document
Parameters:
data - The data for the node.
Returns:
The new Comment object.

createCDATASection

public CDATASection createCDATASection(String data)
                                throws DOMException
Creates a CDATASection node whose value is the specified string.

Specified by:
createCDATASection in interface Document
Parameters:
data - The data for the CDATASection contents.
Returns:
The new CDATASection object.
Throws:
DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(String target,
                                                         String data)
                                                  throws DOMException
Creates a ProcessingInstruction node given the specified name and data strings.

Specified by:
createProcessingInstruction in interface Document
Parameters:
target - The target part of the processing instruction.
data - The data for the node.
Returns:
The new ProcessingInstruction object.
Throws:
DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character.
NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

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
Parameters:
name -
Returns:
@throws DOMException
Throws:
DOMException

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
Return SOAPElements (what if they want SOAPEnvelope or Header/Body?)

Specified by:
createElementNS in interface Document
Parameters:
namespaceURI -
qualifiedName -
Returns:
@throws DOMException
Throws:
DOMException

createAttributeNS

public Attr createAttributeNS(String namespaceURI,
                              String qualifiedName)
                       throws DOMException
Attribute is not particularly dealt with in SAAJ.

Specified by:
createAttributeNS in interface Document
Throws:
DOMException

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI,
                                       String localName)
search the SOAPPart in order of SOAPHeader and SOAPBody for the requested Element name

Specified by:
getElementsByTagNameNS in interface Document

getElementsByTagName

public NodeList getElementsByTagName(String localName)
search the SOAPPart in order of SOAPHeader and SOAPBody for the requested Element name

Specified by:
getElementsByTagName in interface Document

getElementById

public Element getElementById(String elementId)
Returns the Element whose ID is given by elementId. If no such element exists, returns null. Behavior is not defined if more than one element has this ID. The DOM implementation must have information that says which attributes are of type ID. Attributes with the name "ID" are not of type ID unless so defined. Implementations that do not know whether attributes are of type ID or not are expected to return null.

Specified by:
getElementById in interface Document
Parameters:
elementId - The unique id value for an element.
Returns:
The matching element.
Since:
DOM Level 2

getNodeName

public String getNodeName()
Node Implementation

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()
override it in sub-classes

Specified by:
getNodeType in interface Node
Returns:

getParentNode

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

getChildNodes

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

getFirstChild

public Node getFirstChild()
Do we have to count the Attributes as node ????

Specified by:
getFirstChild in interface Node
Returns:

getLastChild

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

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()
we have to have a link to them...

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)
[todo] Study it more.... to implement the deep mode correctly.

Specified by:
cloneNode in interface Node

normalize

public void normalize()
[todo] is it OK to simply call the superclass?

Specified by:
normalize in interface Node

isSupported

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

getPrefix

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

setPrefix

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

getNamespaceURI

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

setNamespaceURI

public void setNamespaceURI(String nsURI)

getLocalName

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

hasAttributes

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

getInputEncoding

public String getInputEncoding()
Specified by:
getInputEncoding in interface Document

getXmlEncoding

public String getXmlEncoding()
Specified by:
getXmlEncoding in interface Document

getXmlStandalone

public boolean getXmlStandalone()
Specified by:
getXmlStandalone in interface Document

setXmlStandalone

public void setXmlStandalone(boolean xmlStandalone)
                      throws DOMException
Specified by:
setXmlStandalone in interface Document
Throws:
DOMException

getXmlVersion

public String getXmlVersion()
Specified by:
getXmlVersion in interface Document

setXmlVersion

public void setXmlVersion(String xmlVersion)
                   throws DOMException
Specified by:
setXmlVersion in interface Document
Throws:
DOMException

getStrictErrorChecking

public boolean getStrictErrorChecking()
Specified by:
getStrictErrorChecking in interface Document

setStrictErrorChecking

public void setStrictErrorChecking(boolean strictErrorChecking)
Specified by:
setStrictErrorChecking in interface Document

getDocumentURI

public String getDocumentURI()
Specified by:
getDocumentURI in interface Document

setDocumentURI

public void setDocumentURI(String documentURI)
Specified by:
setDocumentURI in interface Document

adoptNode

public Node adoptNode(Node source)
               throws DOMException
Specified by:
adoptNode in interface Document
Throws:
DOMException

getDomConfig

public DOMConfiguration getDomConfig()
Specified by:
getDomConfig in interface Document

normalizeDocument

public void normalizeDocument()
Specified by:
normalizeDocument in interface Document

renameNode

public Node renameNode(Node n,
                       String namespaceURI,
                       String qualifiedName)
                throws DOMException
Specified by:
renameNode in interface Document
Throws:
DOMException

getBaseURI

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

compareDocumentPosition

public short compareDocumentPosition(Node other)
                              throws DOMException
Specified by:
compareDocumentPosition in interface Node
Throws:
DOMException

getTextContent

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

setTextContent

public void setTextContent(String textContent)
                    throws DOMException
Specified by:
setTextContent in interface Node
Throws:
DOMException

isSameNode

public boolean isSameNode(Node other)
Specified by:
isSameNode in interface Node

lookupPrefix

public String lookupPrefix(String namespaceURI)
Specified by:
lookupPrefix in interface Node

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)
Specified by:
isDefaultNamespace in interface Node

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)
Specified by:
lookupNamespaceURI in interface Node

isEqualNode

public boolean isEqualNode(Node arg)
Specified by:
isEqualNode in interface Node

getFeature

public Object getFeature(String feature,
                         String version)
Specified by:
getFeature in interface Node

setUserData

public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler)
Specified by:
setUserData in interface Node

getUserData

public Object getUserData(String key)
Specified by:
getUserData in interface Node


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.