Methods Summary |
---|
public org.w3c.dom.Node | appendChild(org.w3c.dom.Node newChild)
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public org.w3c.dom.Node | cloneNode(boolean deep)
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public org.w3c.dom.Attr | createAttribute(java.lang.String name)
return delegate.createAttribute(name);
|
public org.w3c.dom.Attr | createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)Attribute is not particularly dealt with in SAAJ.
return delegate.createAttributeNS(namespaceURI, qualifiedName);
|
public org.w3c.dom.CDATASection | createCDATASection(java.lang.String data)Creates a CDATASection node whose value is the specified
string.
return new CDATAImpl(data);
|
public org.w3c.dom.Comment | createComment(java.lang.String data)Creates a Comment node given the specified string.
return new org.apache.axis.message.CommentImpl(data);
|
public org.w3c.dom.DocumentFragment | createDocumentFragment()Creates an empty DocumentFragment object. @todo not
implemented yet
return delegate.createDocumentFragment();
|
public org.w3c.dom.Element | createElement(java.lang.String tagName)based on the tagName, we will make different kind SOAP Elements Instance
Is really we can determine the Type by the Tagname???
int index = tagName.indexOf(":");
String prefix, localname;
if (index < 0) {
prefix = "";
localname = tagName;
} else {
prefix = tagName.substring(0, index);
localname = tagName.substring(index + 1);
}
try {
SOAPEnvelope soapenv =
(org.apache.axis.message.SOAPEnvelope) soapPart.getEnvelope();
if (soapenv != null) {
if (tagName.equalsIgnoreCase(Constants.ELEM_ENVELOPE))
new SOAPEnvelope();
if (tagName.equalsIgnoreCase(Constants.ELEM_HEADER))
return new SOAPHeader(soapenv, soapenv.getSOAPConstants());
if (tagName.equalsIgnoreCase(Constants.ELEM_BODY))
return new SOAPBody(soapenv, soapenv.getSOAPConstants());
if (tagName.equalsIgnoreCase(Constants.ELEM_FAULT))
return new SOAPEnvelope();
if (tagName.equalsIgnoreCase(Constants.ELEM_FAULT_DETAIL))
return new SOAPFault(new AxisFault(tagName));
else {
return new MessageElement("", prefix, localname);
}
} else {
return new MessageElement("", prefix, localname);
}
} catch (SOAPException se) {
throw new DOMException(DOMException.INVALID_STATE_ERR, "");
}
|
public org.w3c.dom.Element | createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName)Return SOAPElements (what if they want SOAPEnvelope or Header/Body?)
org.apache.axis.soap.SOAPConstants soapConstants = null;
if (Constants.URI_SOAP11_ENV.equals(namespaceURI)) {
soapConstants = org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS;
} else if (Constants.URI_SOAP12_ENV.equals(namespaceURI)) {
soapConstants = org.apache.axis.soap.SOAPConstants.SOAP12_CONSTANTS;
}
// For special SOAP Element
MessageElement me = null;
if (soapConstants != null) {
if (qualifiedName.equals(Constants.ELEM_ENVELOPE)) {
// TODO: confirm SOAP 1.1!
me = new SOAPEnvelope(soapConstants);
} else if (qualifiedName.equals(Constants.ELEM_HEADER)) {
me = new SOAPHeader(null, soapConstants);
// Dummy SOAPEnv required?
} else if (qualifiedName.equals(Constants.ELEM_BODY)) {
me = new SOAPBody(null, soapConstants);
} else if (qualifiedName.equals(Constants.ELEM_FAULT)) {
me = null;
} else if (qualifiedName.equals(Constants.ELEM_FAULT_DETAIL)) {
// TODO:
me = null;
} else {
throw new DOMException(
DOMException.INVALID_STATE_ERR,
"No such Localname for SOAP URI");
}
// TODO:
return null;
// general Elements
} else {
me = new MessageElement(namespaceURI, qualifiedName);
}
if (me != null)
me.setOwnerDocument(soapPart);
return me;
|
public org.w3c.dom.EntityReference | createEntityReference(java.lang.String name)
throw new java.lang.UnsupportedOperationException(
"createEntityReference");
|
public org.w3c.dom.ProcessingInstruction | createProcessingInstruction(java.lang.String target, java.lang.String data)Creates a ProcessingInstruction node given the specified
name and data strings.
throw new java.lang.UnsupportedOperationException(
"createProcessingInstruction");
|
public org.w3c.dom.Text | createTextNode(java.lang.String data)Creates a Text node given the specified string.
org.apache.axis.message.Text me =
new org.apache.axis.message.Text(delegate.createTextNode(data));
me.setOwnerDocument(soapPart);
return me;
|
public org.w3c.dom.NamedNodeMap | getAttributes()
return null;
|
public org.w3c.dom.NodeList | getChildNodes()
try {
if (soapPart != null) {
NodeListImpl children = new NodeListImpl();
children.addNode(soapPart.getEnvelope());
return children;
} else {
return NodeListImpl.EMPTY_NODELIST;
}
} catch (SOAPException se) {
throw new DOMException(DOMException.INVALID_STATE_ERR, "");
}
|
public org.w3c.dom.DocumentType | getDoctype()
return delegate.getDoctype();
|
public org.w3c.dom.Element | getDocumentElement()should not be called, the method will be handled in SOAPPart
return soapPart.getDocumentElement();
|
public org.w3c.dom.Element | getElementById(java.lang.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 .
return delegate.getElementById(elementId);
|
public org.w3c.dom.NodeList | getElementsByTagName(java.lang.String localName)search the SOAPPart in order of SOAPHeader and SOAPBody for the
requested Element name
try {
NodeListImpl list = new NodeListImpl();
if (soapPart != null) {
SOAPEnvelope soapEnv =
(org.apache.axis.message.SOAPEnvelope) soapPart
.getEnvelope();
SOAPHeader header =
(org.apache.axis.message.SOAPHeader) soapEnv.getHeader();
if (header != null) {
list.addNodeList(header.getElementsByTagName(localName));
}
SOAPBody body =
(org.apache.axis.message.SOAPBody) soapEnv.getBody();
if (body != null) {
list.addNodeList(body.getElementsByTagName(localName));
}
}
return list;
} catch (SOAPException se) {
throw new DOMException(DOMException.INVALID_STATE_ERR, "");
}
|
public org.w3c.dom.NodeList | getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)search the SOAPPart in order of SOAPHeader and SOAPBody for the
requested Element name
try {
NodeListImpl list = new NodeListImpl();
if (soapPart != null) {
SOAPEnvelope soapEnv =
(org.apache.axis.message.SOAPEnvelope) soapPart
.getEnvelope();
SOAPHeader header =
(org.apache.axis.message.SOAPHeader) soapEnv.getHeader();
if (header != null) {
list.addNodeList(header.getElementsByTagNameNS(
namespaceURI,
localName));
}
SOAPBody body =
(org.apache.axis.message.SOAPBody) soapEnv.getBody();
if (body != null) {
list.addNodeList(body.getElementsByTagNameNS(
namespaceURI,
localName));
}
}
return list;
} catch (SOAPException se) {
throw new DOMException(DOMException.INVALID_STATE_ERR, "");
}
|
public org.w3c.dom.Node | getFirstChild()Do we have to count the Attributes as node ????
try {
if (soapPart != null)
return (org.apache.axis.message.SOAPEnvelope) soapPart
.getEnvelope();
else
return null;
} catch (SOAPException se) {
throw new DOMException(DOMException.INVALID_STATE_ERR, "");
}
|
public org.w3c.dom.DOMImplementation | getImplementation()
return delegate.getImplementation();
|
public org.w3c.dom.Node | getLastChild()
try {
if (soapPart != null)
return (org.apache.axis.message.SOAPEnvelope) soapPart
.getEnvelope();
else
return null;
} catch (SOAPException se) {
throw new DOMException(DOMException.INVALID_STATE_ERR, "");
}
|
public java.lang.String | getLocalName()
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public java.lang.String | getNamespaceURI()
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public org.w3c.dom.Node | getNextSibling()
return null;
|
public java.lang.String | getNodeName()Node Implementation
return null;
|
public short | getNodeType()override it in sub-classes
return Node.DOCUMENT_NODE;
|
public java.lang.String | getNodeValue()
throw new DOMException(
DOMException.NO_DATA_ALLOWED_ERR,
"Cannot use TextNode.get in " + this);
|
public org.w3c.dom.Document | getOwnerDocument()we have to have a link to them...
return null;
|
public org.w3c.dom.Node | getParentNode()
return null;
|
public java.lang.String | getPrefix()
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public org.w3c.dom.Node | getPreviousSibling()
return null;
|
public boolean | hasAttributes()
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public boolean | hasChildNodes()
try {
if (soapPart != null) {
if (soapPart.getEnvelope() != null) {
return true;
}
}
return false;
} catch (SOAPException se) {
throw new DOMException(DOMException.INVALID_STATE_ERR, "");
}
|
public org.w3c.dom.Node | importNode(org.w3c.dom.Node importedNode, boolean deep)
Node targetNode = null;
int type = importedNode.getNodeType();
switch (type) {
case ELEMENT_NODE :
Element el = (Element) importedNode;
if (deep) {
targetNode = new SOAPBodyElement(el);
break;
}
SOAPBodyElement target = new SOAPBodyElement();
org.w3c.dom.NamedNodeMap attrs = el.getAttributes();
for (int i = 0; i < attrs.getLength(); i++) {
org.w3c.dom.Node att = attrs.item(i);
if (att.getNamespaceURI() != null &&
att.getPrefix() != null &&
att.getNamespaceURI().equals(Constants.NS_URI_XMLNS) &&
att.getPrefix().equals("xmlns")) {
Mapping map = new Mapping(att.getNodeValue(), att.getLocalName());
target.addMapping(map);
}
if (att.getLocalName() != null) {
target.addAttribute(att.getPrefix(),
att.getNamespaceURI(),
att.getLocalName(),
att.getNodeValue());
} else if (att.getNodeName() != null) {
target.addAttribute(att.getPrefix(),
att.getNamespaceURI(),
att.getNodeName(),
att.getNodeValue());
}
}
if (el.getLocalName() == null) {
target.setName(el.getNodeName());
} else {
target.setQName(new QName(el.getNamespaceURI(), el.getLocalName()));
}
targetNode = target;
break;
case ATTRIBUTE_NODE :
if (importedNode.getLocalName() == null) {
targetNode = createAttribute(importedNode.getNodeName());
} else {
targetNode = createAttributeNS(importedNode.getNamespaceURI(),
importedNode.getLocalName());
}
break;
case TEXT_NODE :
targetNode = createTextNode(importedNode.getNodeValue());
break;
case CDATA_SECTION_NODE :
targetNode = createCDATASection(importedNode.getNodeValue());
break;
case COMMENT_NODE :
targetNode = createComment(importedNode.getNodeValue());
break;
case DOCUMENT_FRAGMENT_NODE :
targetNode = createDocumentFragment();
if (deep) {
org.w3c.dom.NodeList children = importedNode.getChildNodes();
for (int i = 0; i < children.getLength(); i++){
targetNode.appendChild(importNode(children.item(i), true));
}
}
break;
case ENTITY_REFERENCE_NODE :
targetNode = createEntityReference(importedNode.getNodeName());
break;
case PROCESSING_INSTRUCTION_NODE :
ProcessingInstruction pi = (ProcessingInstruction) importedNode;
targetNode = createProcessingInstruction(pi.getTarget(), pi.getData());
break;
case ENTITY_NODE :
// TODO : ...
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Entity nodes are not supported.");
case NOTATION_NODE :
// TODO : any idea?
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Notation nodes are not supported.");
case DOCUMENT_TYPE_NODE :
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "DocumentType nodes cannot be imported.");
case DOCUMENT_NODE :
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Document nodes cannot be imported.");
default :
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Node type (" + type + ") cannot be imported.");
}
return targetNode;
|
public org.w3c.dom.Node | insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public boolean | isSupported(java.lang.String feature, java.lang.String version)
if (!version.equalsIgnoreCase(version))
return false;
else
return true;
|
public void | normalize()
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public org.w3c.dom.Node | removeChild(org.w3c.dom.Node oldChild)
try {
Node envNode;
if (soapPart != null) {
envNode = soapPart.getEnvelope();
if (envNode.equals(oldChild)) {
return envNode;
}
}
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
} catch (SOAPException se) {
throw new DOMException(DOMException.INVALID_STATE_ERR, "");
}
|
public org.w3c.dom.Node | replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public void | setNamespaceURI(java.lang.String nsURI)
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|
public void | setNodeValue(java.lang.String nodeValue)
throw new DOMException(
DOMException.NO_DATA_ALLOWED_ERR,
"Cannot use TextNode.set in " + this);
|
public void | setPrefix(java.lang.String prefix)
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "");
|