public interface DOMMessage
Modifier and Type | Method and Description |
---|---|
void |
addAttributeToElements(String exprn,
String qName,
String nsUri,
String value,
String[]... ns)
Add an attribute to each instance of the specified elements
|
void |
addElementsAsChild(String exprn,
String qualifiedTagName,
String namespace,
String[]... ns)
Inserts Element as a child to the specified elements pointed by an xpath expression
|
void |
addStringAsSoapHeader(String name,
String uri,
String content)
Adds a String as a new SOAP header
|
void |
addTextElementsAsChild(String expression,
String qualifiedTagName,
String namespace,
String elementContent,
String[]... ns)
Inserts Text Element as a child to the specified elements pointed by an xpath expression
|
void |
deleteAttributes(String expression,
String[]... ns)
Deletes the specified attribute/attributes from the DOM payload
|
void |
deleteElements(String expression,
String[]... ns)
Delete Elements pointed by an xpath expression
|
void |
deleteSoapHeader(String name,
String uri)
Delete a SOAP header and its descendants
|
String |
extractAsString(String exprn,
String[]... ns)
Extract the result of the given XPath expression as a String
|
NodeList |
extractResultNodeList(String exprn,
String[]... ns)
Get the nodes matching the result of the XPath expression
|
boolean |
filter(String exprn,
String regex,
String[]... ns)
Evaluate if the textual result of the XPath expression evaluation matches the given regex
|
String |
getAttribute(String exprn,
String[]... ns)
Get attribute value
|
Document |
getDocument()
Get the underlying DOM Document
|
InputStream |
getInputStream()
Return an InputStream to read the DOM message payload.
|
String |
getSimpleSOAPHeader(String uri,
String name)
Return a simple SOAP (1.2 or 1.2) header - which has only one String value as its text content.
|
void |
insertTextElementsAfter(String expression,
String qualifiedTagName,
String namespace,
String elementContent,
String[]... ns)
Inserts Text element/s after the specified element/s pointed by an xpath
|
void |
insertTextElementsBefore(String expression,
String qualifiedTagName,
String namespace,
String elementContent,
String[]... ns)
Inserts Text element/s before the specified element/s pointed by an xpath
|
boolean |
remove(String exprn,
String[]... ns)
Removes the resulting node of the XPath expression
|
void |
removeSoapHeader(String name,
String uri)
Removes the specified SOAP header and its descendants if any from the payload
|
void |
replace(String exprn,
Element elem,
String[]... ns)
Replace the result element of the XPath expression with the supplied Element
|
void |
replaceAttribute(String expression,
String value,
String[]... ns)
Replaces the value of the specified attribute/s
e.g replaceXMLAttributeValues(msg, "//order[1]/@id", "8");
|
void |
replaceStringAsSoapHeader(String name,
String uri,
String content)
Replace String based SOAP header
|
void |
replaceTextElements(String expression,
String elementContent,
String[]... ns)
Replace Text Elements pointed by an xpath expression
|
void |
setModified(boolean modified)
Mark message as modified if set to true
|
String |
toString()
Return a LIMITED (to 16K) String representation of the DOM payload.
|
void |
writeTo(OutputStream os)
Write the contents of this message into the provided OutputStream
|
Document getDocument()
void setModified(boolean modified)
modified
- mark as modified when trueString getSimpleSOAPHeader(String uri, String name)
uri
- the namespace URIname
- the element local nameString extractAsString(String exprn, String[]... ns)
exprn
- the XPath expression to evaluatens
- optional array of namespace prefixes and urisNodeList extractResultNodeList(String exprn, String[]... ns)
exprn
- the XPath expression to evaluatens
- optional array of namespace prefixes and urisboolean filter(String exprn, String regex, String[]... ns)
exprn
- the XPath expression to evaluateregex
- the regex to match with the XPath resultns
- optional array of namespace prefixes and urisboolean remove(String exprn, String[]... ns)
exprn
- the XPath expression to select the node to removens
- optional array of namespace prefixes and urisvoid replace(String exprn, Element elem, 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 urisString toString()
void writeTo(OutputStream os) throws IOException
os
- the OutputStream to write toIOException
- on failureInputStream getInputStream() throws IOException
IOException
- on failurevoid addAttributeToElements(String exprn, String qName, String nsUri, String value, 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 expressionString getAttribute(String exprn, 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(String expression, String value, 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 expressionvoid deleteAttributes(String expression, 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(String expression, String qualifiedTagName, String namespace, String elementContent, 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 expressionvoid addElementsAsChild(String exprn, String qualifiedTagName, String namespace, 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 expressionvoid replaceTextElements(String expression, String elementContent, 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 expressionvoid deleteElements(String expression, 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(String expression, String qualifiedTagName, String namespace, String elementContent, 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 expressionvoid insertTextElementsAfter(String expression, String qualifiedTagName, String namespace, String elementContent, 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 expressionvoid removeSoapHeader(String name, String uri)
name
- the local name of the header to be removeduri
- the name space uri of the soap header to be removedvoid addStringAsSoapHeader(String name, String uri, 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(String name, String uri, 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 headerCopyright © 2010–2016 AdroitLogic. All rights reserved.