public interface DOMMessage
Modifier and Type | Method and Description |
---|---|
void |
addAttributeToElements(java.lang.String exprn,
java.lang.String qName,
java.lang.String nsUri,
java.lang.String value,
java.lang.String[][] ns)
Add an attribute to each instance of the specified elements
|
void |
addElementsAsChild(java.lang.String exprn,
java.lang.String[][] ns,
java.lang.String qualifiedTagName,
java.lang.String namespace)
Deprecated.
in favor of
#addElementsAsChild(String, String, String, String[]...)
Inserts Element as a child to the specified elements pointed by an xpath expression |
void |
addElementsAsChild(java.lang.String exprn,
java.lang.String qualifiedTagName,
java.lang.String namespace,
java.lang.String[][] ns)
Inserts Element as a child to the specified elements pointed by an xpath expression
|
void |
addStringAsSoapHeader(java.lang.String name,
java.lang.String uri,
java.lang.String content)
Adds a String as a new SOAP header
|
void |
addTextElementsAsChild(java.lang.String expression,
java.lang.String[][] ns,
java.lang.String qualifiedTagName,
java.lang.String namespace,
java.lang.String elementContent)
Deprecated.
in favor of
#addTextElementsAsChild(String, String, String, String, String[]...)
Inserts Text Element as a child to the specified elements pointed by an xpath expression |
void |
addTextElementsAsChild(java.lang.String expression,
java.lang.String qualifiedTagName,
java.lang.String namespace,
java.lang.String elementContent,
java.lang.String[][] ns)
Inserts Text Element as a child to the specified elements pointed by an xpath expression
|
void |
deleteAttributes(java.lang.String expression,
java.lang.String[][] ns)
Deletes the specified attribute/attributes from the DOM payload
|
void |
deleteElements(java.lang.String expression,
java.lang.String[][] ns)
Delete Elements pointed by an xpath expression
|
void |
deleteSoapHeader(java.lang.String name,
java.lang.String uri)
Delete a SOAP header and its descendants
|
java.lang.String |
extractAsString(java.lang.String exprn,
java.lang.String[][] ns)
Extract the result of the given XPath expression as a String
|
org.w3c.dom.NodeList |
extractResultNodeList(java.lang.String exprn,
java.lang.String[][] ns)
Get the nodes matching the result of the XPath expression
|
boolean |
filter(java.lang.String exprn,
java.lang.String[][] ns,
java.lang.String regex)
Deprecated.
in favor of
#filter(String, String, String[]...)
Evaluate if the textual result of the XPath expression evaluation matches the given regex |
boolean |
filter(java.lang.String exprn,
java.lang.String regex,
java.lang.String[][] ns)
Evaluate if the textual result of the XPath expression evaluation matches the given regex
|
java.lang.String |
getAttribute(java.lang.String exprn,
java.lang.String[][] ns)
Get attribute value
|
org.w3c.dom.Document |
getDocument()
Get the underlying DOM Document
|
java.io.InputStream |
getInputStream()
Return an InputStream to read the DOM message payload.
|
java.lang.String |
getSimpleSOAPHeader(java.lang.String uri,
java.lang.String name)
Return a simple SOAP (1.2 or 1.2) header - which has only one String value as its text content.
|
void |
insertTextElementsAfter(java.lang.String expression,
java.lang.String[][] ns,
java.lang.String qualifiedTagName,
java.lang.String namespace,
java.lang.String elementContent)
Deprecated.
in favor of
#insertTextElementsAfter(String, String, String, String, String[]...)
Inserts Text element/s after the specified element/s pointed by an xpath |
void |
insertTextElementsAfter(java.lang.String expression,
java.lang.String qualifiedTagName,
java.lang.String namespace,
java.lang.String elementContent,
java.lang.String[][] ns)
Inserts Text element/s after the specified element/s pointed by an xpath
|
void |
insertTextElementsBefore(java.lang.String expression,
java.lang.String[][] ns,
java.lang.String qualifiedTagName,
java.lang.String namespace,
java.lang.String elementContent)
Deprecated.
in favor of
#insertTextElementsBefore(String, String, String, String, String[]...)
Inserts Text element/s before the specified element/s pointed by an xpath |
void |
insertTextElementsBefore(java.lang.String expression,
java.lang.String qualifiedTagName,
java.lang.String namespace,
java.lang.String elementContent,
java.lang.String[][] ns)
Inserts Text element/s before the specified element/s pointed by an xpath
|
boolean |
remove(java.lang.String exprn,
java.lang.String[][] ns)
Removes the resulting node of the XPath expression
|
void |
removeSoapHeader(java.lang.String name,
java.lang.String uri)
Removes the specified SOAP header and its descendants if any from the payload
|
void |
replace(java.lang.String exprn,
org.w3c.dom.Element elem,
java.lang.String[][] ns)
Replace the result element of the XPath expression with the supplied Element
|
void |
replace(java.lang.String exprn,
java.lang.String[][] ns,
org.w3c.dom.Element elem)
Deprecated.
in favor of
#replace(String, org.w3c.dom.Element, String[]...)
Replace the result element of the XPath expression with the supplied Element |
void |
replaceAttribute(java.lang.String expression,
java.lang.String[][] ns,
java.lang.String value)
Deprecated.
in favor of
#replaceAttribute(String, String, String[]...)
Replaces the value of the specified attribute/s
e.g replaceXMLAttributeValues(msg, "//order[1]/@id", null, "8"); |
void |
replaceAttribute(java.lang.String expression,
java.lang.String value,
java.lang.String[][] ns)
Replaces the value of the specified attribute/s
e.g replaceXMLAttributeValues(msg, "//order[1]/@id", "8");
|
void |
replaceStringAsSoapHeader(java.lang.String name,
java.lang.String uri,
java.lang.String content)
Replace String based SOAP header
|
void |
replaceTextElements(java.lang.String expression,
java.lang.String[][] ns,
java.lang.String elementContent)
Deprecated.
in favor of
#replaceTextElements(String, String, String[]...)
Replace Text Elements pointed by an xpath expression |
void |
replaceTextElements(java.lang.String expression,
java.lang.String elementContent,
java.lang.String[][] ns)
Replace Text Elements pointed by an xpath expression
|
void |
setModified(boolean modified)
Mark message as modified if set to true
|
java.lang.String |
toString()
Return a LIMITED (to 16K) String representation of the DOM payload.
|
void |
writeTo(java.io.OutputStream os)
Write the contents of this message into the provided OutputStream
|
org.w3c.dom.Document getDocument()
void setModified(boolean modified)
modified
- mark as modified when truejava.lang.String getSimpleSOAPHeader(java.lang.String uri, java.lang.String name)
uri
- the namespace URIname
- the element local namejava.lang.String extractAsString(java.lang.String exprn, java.lang.String[][] ns)
exprn
- the XPath expression to evaluatens
- optional array of namespace prefixes and urisorg.w3c.dom.NodeList extractResultNodeList(java.lang.String exprn, java.lang.String[][] ns)
exprn
- the XPath expression to evaluatens
- optional array of namespace prefixes and urisboolean filter(java.lang.String exprn, java.lang.String regex, java.lang.String[][] ns)
exprn
- the XPath expression to evaluateregex
- the regex to match with the XPath resultns
- optional array of namespace prefixes and uris@Deprecated boolean filter(java.lang.String exprn, java.lang.String[][] ns, java.lang.String regex)
#filter(String, String, String[]...)
Evaluate if the textual result of the XPath expression evaluation matches the given regexexprn
- the XPath expression to evaluatens
- optional array of namespace prefixes and urisregex
- the regex to match with the XPath resultboolean remove(java.lang.String exprn, java.lang.String[][] ns)
exprn
- the XPath expression to select the node to removens
- optional array of namespace prefixes and urisvoid replace(java.lang.String exprn, org.w3c.dom.Element elem, java.lang.String[][] ns)
exprn
- the XPath expression to select the node to replaceelem
- the Element to attach when replacing the current nodens
- optional array of namespace prefixes and uris@Deprecated void replace(java.lang.String exprn, java.lang.String[][] ns, org.w3c.dom.Element elem)
#replace(String, org.w3c.dom.Element, String[]...)
Replace the result element of the XPath expression with the supplied Elementexprn
- the XPath expression to select the node to replacens
- optional array of namespace prefixes and uriselem
- the Element to attach when replacing the current nodejava.lang.String toString()
toString
in class java.lang.Object
void writeTo(java.io.OutputStream os) throws java.io.IOException
os
- the OutputStream to write tojava.io.IOException
- on failurejava.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
- on failurevoid addAttributeToElements(java.lang.String exprn, java.lang.String qName, java.lang.String nsUri, java.lang.String value, java.lang.String[][] ns)
exprn
- the xpath expression to the elements where the attribute should be addedqName
- the qualified name for the new attributensUri
- the namespace URI for the new attribute, or nullvalue
- the new value of the attributens
- an optional array of namespace prefixes and namespaces used within the XPath expressionjava.lang.String getAttribute(java.lang.String exprn, java.lang.String[][] ns)
exprn
- the xpath expression to the element where the attribute should be addedns
- an optional array of namespace prefixes and namespaces used within the XPath expressionvoid replaceAttribute(java.lang.String expression, java.lang.String value, java.lang.String[][] ns)
expression
- the xpath expression to the attribute/s, which should be replacedvalue
- the new value of the attributens
- an optional array of namespace prefixes and namespaces used within the XPath expression@Deprecated void replaceAttribute(java.lang.String expression, java.lang.String[][] ns, java.lang.String value)
#replaceAttribute(String, String, String[]...)
Replaces the value of the specified attribute/s
e.g replaceXMLAttributeValues(msg, "//order[1]/@id", null, "8");expression
- the xpath expression to the attribute/s, which should be replacedns
- an optional array of namespace prefixes and namespaces used within the XPath expressionvalue
- the new value of the attributevoid deleteAttributes(java.lang.String expression, java.lang.String[][] ns)
expression
- the xpath expression to the attribute, which is to be deletedns
- an optional array of namespace prefixes and namespaces used within the XPath expressionvoid addTextElementsAsChild(java.lang.String expression, java.lang.String qualifiedTagName, java.lang.String namespace, java.lang.String elementContent, java.lang.String[][] ns)
expression
- the xpath expression to the node/s, which will be the parent for the new node/squalifiedTagName
- the qualified name of the new element to be addednamespace
- an optional String specifying the namespace url of the new elementelementContent
- the text content of the new elementns
- an optional array of namespace prefixes and namespaces used within the XPath expression@Deprecated void addTextElementsAsChild(java.lang.String expression, java.lang.String[][] ns, java.lang.String qualifiedTagName, java.lang.String namespace, java.lang.String elementContent)
#addTextElementsAsChild(String, String, String, String, String[]...)
Inserts Text Element as a child to the specified elements pointed by an xpath expressionexpression
- the xpath expression to the node/s, which will be the parent for the new node/sns
- an optional array of namespace prefixes and namespaces used within the XPath expressionqualifiedTagName
- the qualified name of the new element to be addednamespace
- an optional String specifying the namespace url of the new elementelementContent
- the text content of the new elementvoid addElementsAsChild(java.lang.String exprn, java.lang.String qualifiedTagName, java.lang.String namespace, java.lang.String[][] ns)
exprn
- the xpath expression to the node/s, which will be the parent for the new node/squalifiedTagName
- the qualified name of the new element to be addednamespace
- an optional String specifying the namespace url of the new elementns
- an optional array of namespace prefixes and namespaces used within the XPath expression@Deprecated void addElementsAsChild(java.lang.String exprn, java.lang.String[][] ns, java.lang.String qualifiedTagName, java.lang.String namespace)
#addElementsAsChild(String, String, String, String[]...)
Inserts Element as a child to the specified elements pointed by an xpath expressionexprn
- the xpath expression to the node/s, which will be the parent for the new node/sns
- an optional array of namespace prefixes and namespaces used within the XPath expressionqualifiedTagName
- the qualified name of the new element to be addednamespace
- an optional String specifying the namespace url of the new elementvoid replaceTextElements(java.lang.String expression, java.lang.String elementContent, java.lang.String[][] ns)
expression
- the xpath expression to the text elements to be replacedelementContent
- the text content of the new element/sns
- an optional array of namespace prefixes and namespaces used within the XPath expression@Deprecated void replaceTextElements(java.lang.String expression, java.lang.String[][] ns, java.lang.String elementContent)
#replaceTextElements(String, String, String[]...)
Replace Text Elements pointed by an xpath expressionexpression
- the xpath expression to the text elements to be replacedns
- an optional array of namespace prefixes and namespaces used within the XPath expressionelementContent
- the text content of the new element/svoid deleteElements(java.lang.String expression, java.lang.String[][] ns)
expression
- the xpath expression to the text elements to be replacedns
- an optional array of namespace prefixes and namespaces used within the XPath expressionvoid insertTextElementsBefore(java.lang.String expression, java.lang.String qualifiedTagName, java.lang.String namespace, java.lang.String elementContent, java.lang.String[][] ns)
expression
- the xpath expression to the element/s where the new element should be added beforequalifiedTagName
- the qualified tag name of the new element to be addednamespace
- namespace uri for the new elementelementContent
- the content of the new elementns
- an optional array of namespace prefixes and namespaces used within the XPath expression@Deprecated void insertTextElementsBefore(java.lang.String expression, java.lang.String[][] ns, java.lang.String qualifiedTagName, java.lang.String namespace, java.lang.String elementContent)
#insertTextElementsBefore(String, String, String, String, String[]...)
Inserts Text element/s before the specified element/s pointed by an xpathexpression
- the xpath expression to the element/s where the new element should be added beforens
- an optional array of namespace prefixes and namespaces used within the XPath expressionqualifiedTagName
- the qualified tag name of the new element to be addednamespace
- namespace uri for the new elementelementContent
- the content of the new elementvoid insertTextElementsAfter(java.lang.String expression, java.lang.String qualifiedTagName, java.lang.String namespace, java.lang.String elementContent, java.lang.String[][] ns)
expression
- the xpath expression to the element/s where the new element should be added afterqualifiedTagName
- the qualified tag name of the new element to be addednamespace
- namespace uri for the new elementelementContent
- the content of the new elementns
- an optional array of namespace prefixes and namespaces used within the XPath expression@Deprecated void insertTextElementsAfter(java.lang.String expression, java.lang.String[][] ns, java.lang.String qualifiedTagName, java.lang.String namespace, java.lang.String elementContent)
#insertTextElementsAfter(String, String, String, String, String[]...)
Inserts Text element/s after the specified element/s pointed by an xpathexpression
- the xpath expression to the element/s where the new element should be added afterns
- an optional array of namespace prefixes and namespaces used within the XPath expressionqualifiedTagName
- the qualified tag name of the new element to be addednamespace
- namespace uri for the new elementelementContent
- the content of the new elementvoid removeSoapHeader(java.lang.String name, java.lang.String uri)
name
- the local name of the header to be removeduri
- the name space uri of the soap header to be removedvoid addStringAsSoapHeader(java.lang.String name, java.lang.String uri, java.lang.String content)
name
- local name of the new header to be addeduri
- the namespace uri of the soap header to be addedcontent
- content of the new headervoid replaceStringAsSoapHeader(java.lang.String name, java.lang.String uri, java.lang.String content)
name
- local name of the header to be replaceduri
- the namespace uri of the soap header to be replacedcontent
- updated content for the SOAP headervoid deleteSoapHeader(java.lang.String name, java.lang.String uri)
name
- local name of the header to be deleteduri
- the namespace uri of the soap header to be deleted