|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface exposes new IBM value-add methods.
Field Summary |
---|
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 |
Method Summary | |
---|---|
SOAPElement |
addComment(java.lang.String text)
Creates a new Comment object initialized with the given String and adds it to this javax.xml.soap.SOAPElement object. |
SOAPElement |
addSwaRefTextNode(java.lang.String mimeType,
java.lang.Object attachment)
Add an swaRef text node to this SOAPElement. |
org.w3c.dom.NodeList |
getChildNodes()
Returns the list of child nodes for this SOAPElement . |
Name |
getNameFromText(java.lang.String text)
A javax.xml.soap.Name is constructed from the input text and the namespace/prefix information defined by the SOAPElement. |
java.lang.Object |
getSwaRefAttachment()
Get the attachment referred to by this swaRef. |
java.lang.Object |
getSwaRefAttachment(SOAPMessage message)
Get the attachment referred to by this swaRef. |
java.lang.String |
getTextFromName(Name name,
boolean autoGenPrefix)
A text String is created that represents the Name. |
boolean |
isSwaRef()
Deterimine if this SOAPElement is an swaRef. |
org.xml.sax.InputSource |
toInputSource(boolean includeNSDecls)
Get an InputSource representing this SOAPElement. |
java.lang.String |
toXMLString(boolean includeNSDecls)
Get a string of xml representing this SOAPElement. |
Methods inherited from interface javax.xml.soap.Node |
---|
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, cloneNode, getAttributes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Methods inherited from interface org.w3c.dom.Element |
---|
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS |
Method Detail |
public java.lang.String toXMLString(boolean includeNSDecls)
There are actually two representations of a SOAPElement as a string:
If includeNSDecls is false, the first representation is used.
If includeNSDecls is true, the second representation is used.
includeNSDecls
- boolean
public org.xml.sax.InputSource toInputSource(boolean includeNSDecls) throws org.xml.sax.SAXException
There are actually two representations of a SOAPElement:
If includeNSDecls is false, the first representation is used.
If includeNSDecls is true, the second representation is used.
includeNSDecls
- boolean
org.xml.sax.SAXException
public Name getNameFromText(java.lang.String text)
Example: Input: text = "pre:foo" SOAPElement =Output: Name with the following information: prefix = "pre" localName = "foo" uri = "http://namespace" qualified name = "pre:foo"
Intended Use: A SOAPElement
may contain a text value or an attribute value that
represents a QName. This utility method is useful for obtaining
the Name from the text.
text
- String representing a QName.
public java.lang.String getTextFromName(Name name, boolean autoGenPrefix)
The SOAPElement is changed to add any necessary namespace/prefix information.
This is the reverse of the getNameFromText
method above.
Example: Input SOAPElement =Name has the following information: prefix = "pre" localName = "foo" uri = "http://namespace" qualified name = "pre:foo" Output: SOAPElement = text = "pre:foo"
Intended Use: A SOAPElement
may contain a text value or an attribute value that
represents a QName. This utility method is useful for setting the
value from a Name object.
name
- autoGenPrefix
- boolean if set to true, the prefix in the Name is ignored and a new prefix is
automatically generated.
public SOAPElement addSwaRefTextNode(java.lang.String mimeType, java.lang.Object attachment) throws SOAPException
This method is an addition to the standard SAAJ functionality. However, this functionality may be added to SAAJ in the future, in which case it will then become deprecated.
mimeType
- MIME data type of the swaRefattachment
- The attachment object. The class of this
object must match the mimeType.
SOAPException
- if the attachment could not be added,
or the attachment object doesn't match the mimeType:
image/gif, image/jpeg ==> java.awt.Image text/plain ==> java.lang.String multipart/* ==> javax.mail.internet.MimeMultipart text/xml, application/xml ==> javax.xml.transform.Source all others ==> javax.activation.DataHandler
SOAPException
public boolean isSwaRef()
SOAPElement
is an swaRef.
This method is an addition to the standard SAAJ functionality. However, this functionality may be added to SAAJ in the future, in which case it will then become deprecated.
SOAPElement
is an swaRefpublic java.lang.Object getSwaRefAttachment() throws SOAPException
SOAPMessage has methods to get attachments. The no-parameter version is slightly less efficient since it has to find the SOAPMessage associated with this SOAPElement.
This method is an addition to the standard SAAJ functionality. However, this functionality may be added to SAAJ in the future, in which case it will then become deprecated.
SOAPException
- if this SOAPElement is not an swaRef
SOAPException
public java.lang.Object getSwaRefAttachment(SOAPMessage message) throws SOAPException
Note that there are two versions of this method: one takes no parameters; the other takes a SOAPMessage.
SOAPMessage has methods to get attachments. The no-parameter version is slightly less efficient since it has to find the SOAPMessage associated with this SOAPElement.
This method is an addition to the standard SAAJ functionality. However, this functionality may be added to SAAJ in the future, in which case it will then become deprecated.
message
- If you have the SOAPMessage associated with
this SOAPElement, give it to this method so it doesn't have
to look for it itself.
SOAPException
- if this SOAPElement is not an swaRef
SOAPException
public org.w3c.dom.NodeList getChildNodes()
SOAPElement
.
Note that the returned NodeList is not thread-safe. In a multi-threaded environment, use the DOM getFirstChild()/getNextSibling() methods to traverse the children.
For example, the following code may fail in a multi-threaded environment:
Here is the same logic using the getFirstChild()/getNextSibling() methods:NodeList nl = el.getChildNodes();
for (int i=0; i<.getLength(); i++) {
Node child = nl.item(i);
...
}
for (Node child = el.getFirstChild();
child != null;
child = child.getNextSibling()) {
...
}
getChildNodes
in interface org.w3c.dom.Node
SOAPElement
public SOAPElement addComment(java.lang.String text) throws SOAPException
text
- a String object with the textual content to be added
SOAPException
- if there is an error in creating the new Comment object
SOAPException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |