com.microstrategy.web.objects.WebExpression |
The WebExpression interface represents a filter expression, which is composed of one or more
WebNode
objects. The root node of an expression can never be null, and cannot be changed
by the user. The root node is generally an operator node with function type "and" or "or". However, if an
expression is obtained from the server, then it does not necessarily have to be rooted at an and or or node.
The expression usually exists as part of
WebPrompt
, WebElementSource
, WebFilter
, and WebTemplate
objects.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract WebOperatorNode |
changeMetricFunctionType(WebOperatorNode rootOperatorNode, int functionType, int function)
Changes the metric function type to the given type.
| ||||||||||
abstract void |
clear()
Removes all nodes from the expression tree, leaving only a single "AND" operator
node with no child nodes at the root of the tree.
| ||||||||||
abstract WebBigDecimalNode |
createBigDecimalNode(String value, WebNode parent)
Creates a
WebBigDecimalNode object. | ||||||||||
abstract WebBigDecimalNode |
createBigDecimalNode(String value)
Creates a
WebBigDecimalNode object. | ||||||||||
abstract WebConstantNode |
createConstantNode(String value, int dataType)
Creates a constant node with the given value and datatype, and appends it to the root node
of the expression tree.
| ||||||||||
abstract WebConstantNode |
createConstantNode(String value, int dataType, WebNode parent)
Creates a constant node with the given value and datatype, and appends it to the given
node.
| ||||||||||
abstract WebElementsObjectNode | createElementsInListNode(WebObjectInfo wa, int func) | ||||||||||
abstract WebElementsObjectNode | createElementsInListNode(WebObjectInfo wa, int func, WebNode parent) | ||||||||||
abstract WebElementsObjectNode |
createElementsObjectNode(WebObjectInfo source, WebNode parent)
Creates an element list node which contains elements from the given attribute.
| ||||||||||
abstract WebElementsObjectNode |
createElementsObjectNode(WebObjectInfo source)
Creates an element list node which contains elements from the given attribute.
| ||||||||||
abstract WebElementsObjectNode |
createElementsObjectNode(WebNode parent)
Creates an element list node, which is used to represent a list of elements in an expression.
| ||||||||||
abstract WebElementsObjectNode |
createElementsObjectNode()
Creates an element list node, which is used to represent a list of elements in an expression.
| ||||||||||
abstract WebFormShortcutNode |
createFormShortcutNode(WebAttribute attributeInfo, WebAttributeForm formInfo, WebNode parent)
Creates a form shortcut node to the given attribute form, and appends it to the
given node.
| ||||||||||
abstract WebFormShortcutNode |
createFormShortcutNode(WebAttribute attributeInfo, WebAttributeForm formInfo)
Creates a form shortcut node to the given attribute form, and appends it to the current root
node.
| ||||||||||
abstract WebGroupNode |
createGroupNode(WebNode parent)
Creates a
WebNode object with type DSSXmlNodeGroup enumeration defined in EnumDSSXMLNodeType . | ||||||||||
abstract WebNode |
createMeNode(WebNode parent)
Creates a me node, and appends it to the given node.
| ||||||||||
abstract WebOperatorNode |
createMetricPercentOperatorNode(WebObjectInfo metricInfo, int mrpOperator, WebNode parent)
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a percent
function.
| ||||||||||
abstract WebOperatorNode |
createMetricPercentOperatorNode(WebObjectInfo metricInfo, int mrpOperator, boolean ascending)
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a rank
function.
| ||||||||||
abstract WebOperatorNode |
createMetricPercentOperatorNode(WebObjectInfo metricInfo, int mrpOperator)
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a percent
function.
| ||||||||||
abstract WebOperatorNode |
createMetricRankOperatorNode(WebObjectInfo metricInfo, int mrpOperator, WebNode parent)
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a rank
function.
| ||||||||||
abstract WebOperatorNode |
createMetricRankOperatorNode(WebObjectInfo metricInfo, int mrpOperator, boolean ascending)
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a rank
function.
| ||||||||||
abstract WebOperatorNode |
createMetricRankOperatorNode(WebObjectInfo metricInfo, int mrpOperator)
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a rank
function.
| ||||||||||
abstract WebNode |
createNode(String expression)
Creates a new
WebNode object using the expression provided and appends it to
the root node. | ||||||||||
abstract WebNode |
createNode(String expression, WebNode parent)
Creates a new
WebNode object using the expression provided and appends it to
the given node. | ||||||||||
abstract WebOperatorNode |
createOperatorNode(int expressionType, int function)
Creates an operator node with the given expression type and function type, and appends it to
the root node of the tree.
| ||||||||||
abstract WebOperatorNode |
createOperatorNode(int expressionType, int function, WebNode parent)
Creates an operator node with the given expression type and function type, and appends it to
the given node within the expression tree.
| ||||||||||
abstract WebRefNode | createRefNode(WebDerivedElement objectInfo, WebNode parent) | ||||||||||
abstract WebRelationshipNode |
createRelationshipNode(WebNode parentNode)
Creates a new relationship node, and appends it to the given node.
| ||||||||||
abstract WebRelationshipNode |
createRelationshipNode()
Creates a new relationship node, and appends it to the root of the expression.
| ||||||||||
abstract WebResidueNode | createResidueNode(WebAttribute attribute, WebNode parent) | ||||||||||
abstract WebShortcutNode |
createShortcutNode(WebObjectInfo objectInfo)
Creates a shortcut node to the given object, and appends it to the root node of the expression
tree.
| ||||||||||
abstract WebShortcutNode |
createShortcutNode(WebObjectInfo objectInfo, WebNode parent)
Creates a shortcut node to the given object, and appends it to the given node.
| ||||||||||
abstract WebTimeNode |
createTimeNode(String time)
Creates a
WebTimeNode object as a child of the root of the expression. | ||||||||||
abstract WebTimeNode |
createTimeNode(String time, WebNode parent)
Creates a
WebTimeNode object. | ||||||||||
abstract WebNode |
findNode(int key)
Returns the
WebNode within the expression tree with the given key. | ||||||||||
abstract WebNode | findNodeOrNull(int key) | ||||||||||
abstract WebNode |
findTaggedNode(String tag)
This method will search the expression for a node with the given tag.
| ||||||||||
abstract WebExpressionHelper |
getExpressionHelper()
This method is used to obtain a
WebExpressionHelper object linked to this
expression. | ||||||||||
abstract List<WebNodePlaceHolder> |
getPlaceHolders()
Returns a list of placeholders defined in the nodes of this expression.
| ||||||||||
abstract WebNode |
getRootNode()
Returns the current root node of the expression.
| ||||||||||
abstract int |
getSubExpressionCount()
Returns the number of subexpressions of the root node.
| ||||||||||
abstract String |
getXML(boolean removeEmpty)
Builds an expression XML
| ||||||||||
abstract String | getXML() | ||||||||||
abstract WebNode |
importNode(WebNode otherNode)
This method is used to transfer node subtrees between two expressions.
| ||||||||||
abstract boolean |
isModified()
Returns whether this expression object has been modified.
| ||||||||||
abstract void |
populate(WebExpression expr)
Populates the current expression from the definition of the given expression.
| ||||||||||
abstract void |
populate(String expressionText)
Populates WebExpression based on a string expression.
| ||||||||||
abstract void | setExpressionHelper(WebExpressionHelper value) | ||||||||||
abstract void |
setModified(boolean isModified)
This method allows the user to mark this expression object as modified or unmodified.
|
Changes the metric function type to the given type. This method assumes that the operator node is well-formed, i.e. that it has a shortcut to the metric which is being qualified upon set up appropriately. It will then change the function type of the node, setting up the rest of the tree properly.
rootOperatorNode | The operator node whose function type is being changed. |
---|---|
functionType | The function type, from EnumWebFunctionType , to change the node to. |
function | The function, from either EnumDSSXMLFunction for a generic qualification, or
from EnumWebMRPFunction for a metric rank/percent function. |
Removes all nodes from the expression tree, leaving only a single "AND" operator node with no child nodes at the root of the tree.
UnsupportedOperationException | Thrown if the object is read-only. |
---|
Creates a WebBigDecimalNode
object. This is used when creating a qualification
on an attribute form with a big decimal datatype.
value | The string representation of the node value. |
---|---|
parent | The node to append the newly created one to. |
WebBigDecimalNode
object.Creates a WebBigDecimalNode
object. This is used when creating a qualification
on an attribute form with a big decimal datatype.
value | The string representation of the node value. |
---|
WebBigDecimalNode
object.Creates a constant node with the given value and datatype, and appends it to the root node of the expression tree.
value | The constant value being represented by the constant node. This value should be in string format regardless of the data type. |
---|---|
dataType | The data type of the constant value. This should be a value from EnumDSSXMLDataType . |
WebConstantNode
.
Creates a constant node with the given value and datatype, and appends it to the given node.
value | The constant value being represented by the constant node. This value should be in string format regardless of the data type. |
---|---|
dataType | The data type of the constant value. This should be a value from EnumDSSXMLDataType . |
parent | The node which the newly created node should be appended to. |
WebConstantNode
object.
Creates an element list node which contains elements from the given attribute. The new node will be appended to the given parent node.
source | A WebAttribute object representing the attribute
which the element list will come from. |
---|---|
parent | The node to append the newly created node to. |
WebElementsObjectNode
object.
Creates an element list node which contains elements from the given attribute. The new node will be appended to the root of the expression tree.
source | A WebAttribute object representing the attribute
which the element list will come from. |
---|
WebElementsObjectNode
object.
Creates an element list node, which is used to represent a list of elements in an expression. The new node will be appended to the given parent node.
parent | The node to append the newly created node to. |
---|
WebElementsObjectNode
object.
Creates an element list node, which is used to represent a list of elements in an expression. The new node will be appended to the root of the expression tree.
WebElementsObjectNode
object.
Creates a form shortcut node to the given attribute form, and appends it to the given node.
attributeInfo | The attribute whose form the shortcut points to. |
---|---|
formInfo | The attribute form which the shortcut refers to. |
parent | The node which the new node will be appended to. |
WebFormShortcutNode
object.IllegalArgumentException | Thrown if the WebObjectInfo objects
are null.
|
---|
Creates a form shortcut node to the given attribute form, and appends it to the current root node.
attributeInfo | The attribute whose form the shortcut points to. |
---|---|
formInfo | The attribute form which the shortcut refers to. |
WebFormShortcutNode
object.IllegalArgumentException | Thrown if the WebObjectInfo objects
are null.
|
---|
Creates a WebNode
object with type DSSXmlNodeGroup enumeration defined in EnumDSSXMLNodeType
. This is not used
in OOTB Web. @deprecated
IllegalArgumentException |
---|
Creates a me node, and appends it to the given node.
parent | The node which the newly created node will be appended to. |
---|
WebShortcutNode
object.IllegalArgumentException | Thrown if the value of the WebObjectInfo
object is null. |
---|
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a percent function. The newly-created node will be appended to the given node.
metricInfo | Specifies the metric to be qualified upon. |
---|---|
mrpOperator | Specifies the operator for metric qualification. This value should come from EnumWebMRPFunction . |
parent | The parent node of the newly created node. |
WebOperatorNode
of the nodes which are created for this operation.IllegalArgumentException | Thrown if the metricInfo node is null or is not of type metric. Also thrown if the MRP operator is invalid. |
---|
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a rank function. The newly-created node will be appended to the given node.
metricInfo | Specifies the metric to be qualified upon. |
---|---|
mrpOperator | Specifies the operator for metric qualification. This value should come from EnumWebMRPFunction . |
ascending | The boolean value which indicate the order of rank function |
WebOperatorNode
of the nodes which are created for this operation.IllegalArgumentException | Thrown if the metricInfo node is null or is not of type metric. Also thrown if the MRP operator is invalid. |
---|
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a percent function. This method will assume that the parent node of this one will be the root node of the expression.
metricInfo | Specifies the metric to be qualified upon. |
---|---|
mrpOperator | Specifies the operator for metric qualification. This value should come from EnumWebMRPFunction . |
WebOperatorNode
of the nodes which are created for this operation.IllegalArgumentException | Thrown if the metricInfo node is null or is not of type metric. Also thrown if the MRP operator is invalid. |
---|
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a rank function. The newly-created node will be appended to the given node.
metricInfo | Specifies the metric to be qualified upon. |
---|---|
mrpOperator | Specifies the operator for metric qualification. This value should come from EnumWebMRPFunction . |
parent | The parent node of the newly created node. |
WebOperatorNode
of the nodes which are created for this operation.IllegalArgumentException | Thrown if the metricInfo node is null or is not of type metric. Also thrown if the MRP operator is invalid. |
---|
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a rank function. The newly-created node will be appended to the given node.
metricInfo | Specifies the metric to be qualified upon. |
---|---|
mrpOperator | Specifies the operator for metric qualification. This value should come from EnumWebMRPFunction . |
ascending | The boolean value which indicate the order of rank function |
WebOperatorNode
of the nodes which are created for this operation.IllegalArgumentException | Thrown if the metricInfo node is null or is not of type metric. Also thrown if the MRP operator is invalid. |
---|
Creates a node and all the required sub-nodes to enable users to build expression that qualify on metric using a rank function. This method will assume that the parent node of this one will be the root node of the expression.
metricInfo | Specifies the metric to be qualified upon. |
---|---|
mrpOperator | Specifies the operator for metric qualification. This value should come from EnumWebMRPFunction . |
WebOperatorNode
of the nodes which are created for this operation.IllegalArgumentException | Thrown if the metricInfo node is null or is not of type metric. Also thrown if the MRP operator is invalid. |
---|
Creates a new WebNode
object using the expression provided and appends it to
the root node.
expression | Expression string, like "[Customer Age]@ID < 25.0" for example. |
---|
WebObjectsException | |
WebObjectsException |
Creates a new WebNode
object using the expression provided and appends it to
the given node.
expression | Expression string, like "[Customer Age]@ID < 25.0" for example. |
---|---|
parent | Node to which to append the new node |
WebObjectsException | |
WebObjectsException |
Creates an operator node with the given expression type and function type, and appends it to the root node of the tree.
expressionType | The type of the subexpression rooted at the operator node,
from EnumDSSXMLExpressionType . |
---|---|
function | The function to assign to the operator node, from EnumDSSXMLFunction . |
WebOperatorNode
.
Creates an operator node with the given expression type and function type, and appends it to the given node within the expression tree.
expressionType | The type of the subexpression rooted at the operator node,
from EnumDSSXMLExpressionType . |
---|---|
function | The function to assign to the operator node, from EnumDSSXMLFunction . |
parent | A WebOperatorNode object which will serve as the parent of the newly created
operator node |
WebOperatorNode
.
IllegalArgumentException |
---|
Creates a new relationship node, and appends it to the given node.
parentNode | The node which is meant to be the parent of the newly created node. |
---|
WebRelationshipNode
object.
Creates a new relationship node, and appends it to the root of the expression.
WebRelationshipNode
object.
IllegalArgumentException |
---|
Creates a shortcut node to the given object, and appends it to the root node of the expression tree.
objectInfo | The WebObjectInfo object which a shortcut is being made to. |
---|
WebShortcutNode
object.IllegalArgumentException | Thrown if the value of the WebObjectInfo object is null.
|
---|
Creates a shortcut node to the given object, and appends it to the given node.
objectInfo | The WebObjectInfo object which a shortcut is being made to. |
---|---|
parent | The node which the newly created node will be appended to. |
WebShortcutNode
object.IllegalArgumentException | Thrown if the value of the WebObjectInfo
object is null.
|
---|
Creates a WebTimeNode
object as a child of the root of the expression.
This is used when creating a qualification on an attribute form with a time-based
datatype.
time | The string representation of the time to use for the node. |
---|
WebTimeNode
object.
Creates a WebTimeNode
object. This is used when creating a qualification
on an attribute form with a time-based datatype.
time | The string representation of the time to use for the node. |
---|---|
parent | The node to append the newly created one to. |
WebTimeNode
object.
Returns the WebNode
within the expression tree with the given key.
key | The key to find within the expression tree. |
---|
WebNode
object corresponding to the given key, or null if
the key does not exist in the expression tree.IllegalArgumentException | Thrown if the key is not found in the expression. |
---|
This method will search the expression for a node with the given tag. Either the first one found, or null if none are found, will be returned. There is no guarantee as to which node will be returned from this method if more than one has the tag passed to this method.
tag | The tag to search for in the expression. |
---|
WebNode
found with the given tag, or null if no node with
the given tag is found.
This method is used to obtain a WebExpressionHelper
object linked to this
expression. The WebExpressionHelper
object has several helper methods for manipulating the expression tree.
WebExpressionHelper
object linked to this expression.
Returns a list of placeholders defined in the nodes of this expression.
Returns the current root node of the expression. While this node's properties can be changed (for example, the function being applied), the actual root node cannot be replaced.
Returns the number of subexpressions of the root node. This will be a simple count of the number of children of the root node.
Builds an expression XML
removeEmpty | Indicates whethe empty nodes shall be removed from the expression before building. |
---|
This method is used to transfer node subtrees between two expressions. This must be done before appending a node from one expression to a node in another expression. If a node from another expression is passed to this method, a copy of the node is returned. This copy will be associated with the instance of WebExpression which this method was called on. Note that the import process will cause the keys of the subexpression to be reassigned. Finally, the copy of the node will be returned from this method; this copy can be appended anywhere within the expression that this method is called upon.
otherNode | The node to import into this expression. This node will remain untouched in it's original expression. |
---|
IllegalArgumentException | Thrown if the parameter is null. |
---|
Returns whether this expression object has been modified.
Populates the current expression from the definition of the given expression. This will effectively make a copy of the structure of the expression passed in within this expression.
expr | A WebExpression object whose definition is to be copied into this object. |
---|
Populates WebExpression based on a string expression. It supports everything that the backend expression parser supports like Region@ID=2 or Region@Desc in ("North-East"). This is not currently used by OOTB Web but it is used by the Command Manager.
WebObjectsException |
---|
This method allows the user to mark this expression object as modified or unmodified. This is useful when using a copy of an expression to save previous expression state.
isModified | The new value for isModified. This will override the current setting for this parameter. |
---|