org.apache.axis.message

Class SOAPDocumentImpl

public class SOAPDocumentImpl extends Object implements Document, Serializable

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
protected Documentdelegate
protected SOAPPartsoapPart
Constructor Summary
SOAPDocumentImpl(SOAPPart sp)
Construct the Document
Method Summary
NodeadoptNode(Node source)
NodeappendChild(Node newChild)
NodecloneNode(boolean deep)
shortcompareDocumentPosition(Node other)
AttrcreateAttribute(String name)
AttrcreateAttributeNS(String namespaceURI, String qualifiedName)
Attribute is not particularly dealt with in SAAJ.
CDATASectioncreateCDATASection(String data)
Creates a CDATASection node whose value is the specified string.
CommentcreateComment(String data)
Creates a Comment node given the specified string.
DocumentFragmentcreateDocumentFragment()
Creates an empty DocumentFragment object.
ElementcreateElement(String tagName)
based on the tagName, we will make different kind SOAP Elements Instance Is really we can determine the Type by the Tagname?
ElementcreateElementNS(String namespaceURI, String qualifiedName)
Return SOAPElements (what if they want SOAPEnvelope or Header/Body?)
EntityReferencecreateEntityReference(String name)
ProcessingInstructioncreateProcessingInstruction(String target, String data)
Creates a ProcessingInstruction node given the specified name and data strings.
TextcreateTextNode(String data)
Creates a Text node given the specified string.
NamedNodeMapgetAttributes()
StringgetBaseURI()
DOM Level 3 stubs
NodeListgetChildNodes()
DocumentTypegetDoctype()
ElementgetDocumentElement()
should not be called, the method will be handled in SOAPPart
StringgetDocumentURI()
DOMConfigurationgetDomConfig()
ElementgetElementById(String elementId)
Returns the Element whose ID is given by elementId.
NodeListgetElementsByTagName(String localName)
search the SOAPPart in order of SOAPHeader and SOAPBody for the requested Element name
NodeListgetElementsByTagNameNS(String namespaceURI, String localName)
search the SOAPPart in order of SOAPHeader and SOAPBody for the requested Element name
ObjectgetFeature(String feature, String version)
NodegetFirstChild()
Do we have to count the Attributes as node ?
DOMImplementationgetImplementation()
StringgetInputEncoding()
NodegetLastChild()
StringgetLocalName()
StringgetNamespaceURI()
NodegetNextSibling()
StringgetNodeName()
Node Implementation
shortgetNodeType()
override it in sub-classes
StringgetNodeValue()
DocumentgetOwnerDocument()
we have to have a link to them...
NodegetParentNode()
StringgetPrefix()
NodegetPreviousSibling()
booleangetStrictErrorChecking()
StringgetTextContent()
ObjectgetUserData(String key)
StringgetXmlEncoding()
booleangetXmlStandalone()
StringgetXmlVersion()
booleanhasAttributes()
booleanhasChildNodes()
NodeimportNode(Node importedNode, boolean deep)
NodeinsertBefore(Node newChild, Node refChild)
booleanisDefaultNamespace(String namespaceURI)
booleanisEqualNode(Node arg)
booleanisSameNode(Node other)
booleanisSupported(String feature, String version)
StringlookupNamespaceURI(String prefix)
StringlookupPrefix(String namespaceURI)
voidnormalize()
voidnormalizeDocument()
NoderemoveChild(Node oldChild)
NoderenameNode(Node n, String namespaceURI, String qualifiedName)
NodereplaceChild(Node newChild, Node oldChild)
voidsetDocumentURI(String documentURI)
voidsetNamespaceURI(String nsURI)
voidsetNodeValue(String nodeValue)
voidsetPrefix(String prefix)
voidsetStrictErrorChecking(boolean strictErrorChecking)
voidsetTextContent(String textContent)
ObjectsetUserData(String key, Object data, UserDataHandler handler)
voidsetXmlStandalone(boolean xmlStandalone)
voidsetXmlVersion(String xmlVersion)

Field Detail

delegate

protected Document delegate

soapPart

protected SOAPPart soapPart

Constructor Detail

SOAPDocumentImpl

public SOAPDocumentImpl(SOAPPart sp)
Construct the Document

Parameters: sp the soap part

Method Detail

adoptNode

public Node adoptNode(Node source)

appendChild

public Node appendChild(Node newChild)

cloneNode

public Node cloneNode(boolean deep)

UNKNOWN: Study it more.... to implement the deep mode correctly.

compareDocumentPosition

public short compareDocumentPosition(Node other)

createAttribute

public Attr createAttribute(String name)

UNKNOWN: How Axis will maintain the Attribute representation ?

createAttributeNS

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

createCDATASection

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

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.

createComment

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

Parameters: data The data for the node.

Returns: The new Comment object.

createDocumentFragment

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

Returns: A new DocumentFragment.

createElement

public 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???

Parameters: tagName

Returns: @throws DOMException

UNKNOWN: : verify this method

createElementNS

public Element createElementNS(String namespaceURI, String qualifiedName)
Return SOAPElements (what if they want SOAPEnvelope or Header/Body?)

Parameters: namespaceURI qualifiedName

Returns: @throws DOMException

createEntityReference

public EntityReference createEntityReference(String name)

Parameters: name

Returns: @throws DOMException

createProcessingInstruction

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

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.

createTextNode

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

Parameters: data The data for the node.

Returns: The new Text object.

getAttributes

public NamedNodeMap getAttributes()

getBaseURI

public String getBaseURI()
DOM Level 3 stubs

getChildNodes

public NodeList getChildNodes()

getDoctype

public DocumentType getDoctype()

Returns:

UNKNOWN: : link with SOAP

getDocumentElement

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

Returns:

getDocumentURI

public String getDocumentURI()

getDomConfig

public DOMConfiguration getDomConfig()

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.

Parameters: elementId The unique id value for an element.

Returns: The matching element.

Since: DOM Level 2

getElementsByTagName

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

getElementsByTagNameNS

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

getFeature

public Object getFeature(String feature, String version)

getFirstChild

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

Returns:

getImplementation

public DOMImplementation getImplementation()

getInputEncoding

public String getInputEncoding()

getLastChild

public Node getLastChild()

Returns:

getLocalName

public String getLocalName()

getNamespaceURI

public String getNamespaceURI()

getNextSibling

public Node getNextSibling()

getNodeName

public String getNodeName()
Node Implementation

getNodeType

public short getNodeType()
override it in sub-classes

Returns:

getNodeValue

public String getNodeValue()

getOwnerDocument

public Document getOwnerDocument()
we have to have a link to them...

getParentNode

public Node getParentNode()

getPrefix

public String getPrefix()

getPreviousSibling

public Node getPreviousSibling()

getStrictErrorChecking

public boolean getStrictErrorChecking()

getTextContent

public String getTextContent()

getUserData

public Object getUserData(String key)

getXmlEncoding

public String getXmlEncoding()

getXmlStandalone

public boolean getXmlStandalone()

getXmlVersion

public String getXmlVersion()

hasAttributes

public boolean hasAttributes()

hasChildNodes

public boolean hasChildNodes()

importNode

public Node importNode(Node importedNode, boolean deep)

insertBefore

public Node insertBefore(Node newChild, Node refChild)

isDefaultNamespace

public boolean isDefaultNamespace(String namespaceURI)

isEqualNode

public boolean isEqualNode(Node arg)

isSameNode

public boolean isSameNode(Node other)

isSupported

public boolean isSupported(String feature, String version)

lookupNamespaceURI

public String lookupNamespaceURI(String prefix)

lookupPrefix

public String lookupPrefix(String namespaceURI)

normalize

public void normalize()

UNKNOWN: is it OK to simply call the superclass?

normalizeDocument

public void normalizeDocument()

removeChild

public Node removeChild(Node oldChild)

renameNode

public Node renameNode(Node n, String namespaceURI, String qualifiedName)

replaceChild

public Node replaceChild(Node newChild, Node oldChild)

setDocumentURI

public void setDocumentURI(String documentURI)

setNamespaceURI

public void setNamespaceURI(String nsURI)

setNodeValue

public void setNodeValue(String nodeValue)

setPrefix

public void setPrefix(String prefix)

setStrictErrorChecking

public void setStrictErrorChecking(boolean strictErrorChecking)

setTextContent

public void setTextContent(String textContent)

setUserData

public Object setUserData(String key, Object data, UserDataHandler handler)

setXmlStandalone

public void setXmlStandalone(boolean xmlStandalone)

setXmlVersion

public void setXmlVersion(String xmlVersion)
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.