public class MbXPathVariables
extends java.lang.Object
evaluateXPath()
or
evaluateXPath()
.Constructor and Description |
---|
MbXPathVariables() |
Modifier and Type | Method and Description |
---|---|
void |
assign(java.lang.String variable,
boolean value)
Assigns a new value to the named external variable binding in the
current object.
|
void |
assign(java.lang.String variable,
double value)
Assigns a new value to the named external variable binding in the
current object.
|
void |
assign(java.lang.String variable,
java.lang.Object value)
Assigns a new value to the named external variable binding in the
current object.
|
void |
remove(java.lang.String variable)
Removes the currently assigned value of the named external variable binding.
|
void |
removeAll()
Removes the currently assigned values of all the named external variable bindings.
|
void |
setRootElement(MbElement rootElement)
By default the XPath 'root node' is set as the last child
of the MbMessage root.
|
public void assign(java.lang.String variable, boolean value)
variable
- The name of the variable reference. This can be referred to
in the XPath 1.0 expression by inserting a dollar ($) symbol before the variable name.value
- The value to be assigned to the variable. The value represents
an XPath 1.0 boolean type.public void assign(java.lang.String variable, double value)
variable
- The name of the variable reference. This can be referred to
in the XPath 1.0 expression by inserting a dollar ($) symbol before the variable name.value
- The value to be assigned to the variable. The value represents
an XPath 1.0 numeric type.public void assign(java.lang.String variable, java.lang.Object value)
variable
- The name of the variable reference. This can be referred to
in the XPath 1.0 expression by inserting a dollar ($) symbol before the variable name.value
- The value to be assigned to the variable. Must be one of:
Boolean
- representing an XPath 1.0 boolean.
Double
- representing an XPath 1.0 number.
String
- representing an XPath 1.0 string.
MbElement
- representing an XPath 1.0 nodeset (single node).
MbElement[]
- an array of MbElement objects,
representing an XPath 1.0 nodeset.
java.util.List
- a list of MbElement objects,
such as a nodeset returned by MbElement.evaluateXPath().
java.lang.ArrayStoreException
- - A List was passed in which contains one or more
objects which are not of type MbElement.public void removeAll()
public void remove(java.lang.String variable)
variable
- The name of the variable to remove.public void setRootElement(MbElement rootElement)
This method allows an alternative root node to be defined. Absolute path locations start at this root node.
Care must be taken over terminology differences between IIB and XPath. In XPath, the 'root node' is not an 'element node' and will not get matched by an expression step matching a named element or element wildcard. See http://www.w3.org/TR/xpath/#root-node.
rootElement
- The element to be used as XPath 'root node'