public class

ExpressionStringsImpl

extends Object
implements ExpressionStrings
java.lang.Object
   ↳ com.microstrategy.web.transform.ExpressionStringsImpl
Known Direct Subclasses

Class Overview

A helper class that builds a collection of expression parts that can be used to build expression GUI. This collection contains part name - part value pairs.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.web.transform.ExpressionStrings
Public Constructors
ExpressionStringsImpl(ExpressionObject pOb)
Constructs expression parts object for a specified expression object.
ExpressionStringsImpl(ExpressionObject pOb, Locale locale)
Constructs expression parts object for a specified expression object and a given locale
Protected Constructors
ExpressionStringsImpl(ExpressionStringsImpl parent)
This constructor is used when a child ExpressionParts object is used to build subexpression string.
Public Methods
void buildExpressionParts(WebNode node)
Builds expression parts collection for a specified expression node.
String getConstNodeVal(WebNode node)
A helper method that extracts value from the constant and time nodes.
String getExpressionStr()
Builds and returns user-friendly expression string from the expression parts
String getPart(String name)
Returns specified expresson part or null if the part does not exist.
boolean hasPart(String name)
Returns true if the collection contains part with specified name
void setDataSets(RWDataSets value)
void setPart(String name, String value)
Sets specified part value
void setShowDynamicDatesAsStatic(boolean val)
void setUseMathOperators(boolean val)
boolean showDynamicDatesAsStatic()
boolean useMathOperators()
Protected Methods
void addMrpPrefix(WebOperatorNode node)
A helper method used to add rank/percent prefix to the left operand part
void buildAndOrOperatorParts(WebOperatorNode node, String operatorName)
A helper method used to build expression parts for infix operators
void buildBetweenOperatorParts(WebOperatorNode node, String operatorName)
A helper method used to build expression parts for BETWEEN operators
void buildBreakByPart(WebOperatorNode node)
void buildDescendantsParts(WebOperatorNode node)
String buildDimtyStr(WebOperatorNode node)
void buildExprParts(WebOperatorNode node)
A helper method called from the {link buildExpressionParts} to build expression parts for all expression types excluding rank and percent metric expressions.
void buildFormShortcutParts(WebFormShortcutNode node)
A helper method used to build expression parts (left operand and attribute form) for the form shortcut node
void buildFunction(WebOperatorNode node, String functionName)
A helper method used to build a tuple string representation
void buildInOperatorParts(WebOperatorNode node, String operatorName)
A helper method used to build expression parts for IN operators
void buildInfixOperatorParts(WebOperatorNode node, String operatorName)
A helper method used to build expression parts for infix operators
void buildLeftOperandFromOperator(WebOperatorNode node)
A helper method called from the buildLeftOperandParts(WebOperatorNode) to build left operand parts in the case the left operand is an operator.
void buildLeftOperandParts(WebOperatorNode node)
A helper method used to build left operand parts
void buildMrpParts(WebOperatorNode node)
A helper method called from the buildExpressionParts(WebNode) to build expression parts for rank and percent metric expressions.
void buildOutputLevelPart(WebOperatorNode node)
A helper method that builds and adds to the parts collection a dimensionality expression part
void buildPostfixOperatorParts(WebOperatorNode node, String operatorName)
A helper method used to build expression parts for postfix operators
void buildPrefixOperatorParts(WebOperatorNode node, String operatorName)
A helper method used to build expression parts for prefix operators
String getMessageStr(int key, String param)
A helper method that obtains a proper string from the resource bundle and replaces the "##" substring in it with the param value
String getMessageStr(int key)
A helper method that obtains a proper string from the resource bundle
String getNodeStr(WebNode node)
A helper method used to build string representation of expression sub-nodes.
String getTupleStr(WebOperatorNode node)
A helper method used to build a tuple string representation
void logWarning(String message)
A helper method that logs warnings
ExpressionStringsImpl newExpressionParts(WebNode node)
A helper factory method that creates new ExpressionParts instances for the getNodeStr(WebNode) method.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.microstrategy.web.transform.ExpressionStrings

Public Constructors

public ExpressionStringsImpl (ExpressionObject pOb)

Constructs expression parts object for a specified expression object.

public ExpressionStringsImpl (ExpressionObject pOb, Locale locale)

Constructs expression parts object for a specified expression object and a given locale

Protected Constructors

protected ExpressionStringsImpl (ExpressionStringsImpl parent)

This constructor is used when a child ExpressionParts object is used to build subexpression string.

Parameters
parent a parent ExpressionParts objects

Public Methods

public void buildExpressionParts (WebNode node)

Builds expression parts collection for a specified expression node.

Parameters
node expression node

public String getConstNodeVal (WebNode node)

A helper method that extracts value from the constant and time nodes. It also wraps in quotes string and time constant values.

public String getExpressionStr ()

Builds and returns user-friendly expression string from the expression parts

Returns
  • name a part name

public String getPart (String name)

Returns specified expresson part or null if the part does not exist.

Parameters
name a part name
Returns
  • a part value

public boolean hasPart (String name)

Returns true if the collection contains part with specified name

Parameters
name a part name
Returns
  • true if the collection contains part with specified name

public void setDataSets (RWDataSets value)

public void setPart (String name, String value)

Sets specified part value

Parameters
name a part name
value a part value

public void setShowDynamicDatesAsStatic (boolean val)

public void setUseMathOperators (boolean val)

public boolean showDynamicDatesAsStatic ()

public boolean useMathOperators ()

Protected Methods

protected void addMrpPrefix (WebOperatorNode node)

A helper method used to add rank/percent prefix to the left operand part

Parameters
node an expression node

protected void buildAndOrOperatorParts (WebOperatorNode node, String operatorName)

A helper method used to build expression parts for infix operators

Parameters
node operator node
operatorName an operator name like "Grater then" or "+" and so on.

protected void buildBetweenOperatorParts (WebOperatorNode node, String operatorName)

A helper method used to build expression parts for BETWEEN operators

Parameters
node operator node
operatorName an operator name ("between" or "not between").

protected void buildBreakByPart (WebOperatorNode node)

protected void buildDescendantsParts (WebOperatorNode node)

protected String buildDimtyStr (WebOperatorNode node)

protected void buildExprParts (WebOperatorNode node)

A helper method called from the {link buildExpressionParts} to build expression parts for all expression types excluding rank and percent metric expressions.

Parameters
node expression node

protected void buildFormShortcutParts (WebFormShortcutNode node)

A helper method used to build expression parts (left operand and attribute form) for the form shortcut node

Parameters
node a for shortcut node

protected void buildFunction (WebOperatorNode node, String functionName)

A helper method used to build a tuple string representation

Parameters
node a sub-node representing a tuple

protected void buildInOperatorParts (WebOperatorNode node, String operatorName)

A helper method used to build expression parts for IN operators

Parameters
node operator node
operatorName an operator name ("in" or "not in").

protected void buildInfixOperatorParts (WebOperatorNode node, String operatorName)

A helper method used to build expression parts for infix operators

Parameters
node operator node
operatorName an operator name like "Grater then" or "+" and so on.

protected void buildLeftOperandFromOperator (WebOperatorNode node)

A helper method called from the buildLeftOperandParts(WebOperatorNode) to build left operand parts in the case the left operand is an operator.

Parameters
node a sub-node representing left operand

protected void buildLeftOperandParts (WebOperatorNode node)

A helper method used to build left operand parts

Parameters
node an expression node

protected void buildMrpParts (WebOperatorNode node)

A helper method called from the buildExpressionParts(WebNode) to build expression parts for rank and percent metric expressions.

Parameters
node expression node

protected void buildOutputLevelPart (WebOperatorNode node)

A helper method that builds and adds to the parts collection a dimensionality expression part

Parameters
node an expression node

protected void buildPostfixOperatorParts (WebOperatorNode node, String operatorName)

A helper method used to build expression parts for postfix operators

Parameters
node operator node
operatorName an operator name like "is null" and so on.

protected void buildPrefixOperatorParts (WebOperatorNode node, String operatorName)

A helper method used to build expression parts for prefix operators

Parameters
node operator node
operatorName an operator name like "Not" or "-" and so on.

protected String getMessageStr (int key, String param)

A helper method that obtains a proper string from the resource bundle and replaces the "##" substring in it with the param value

Parameters
key a message key
param a string parameter

protected String getMessageStr (int key)

A helper method that obtains a proper string from the resource bundle

Parameters
key a message key

protected String getNodeStr (WebNode node)

A helper method used to build string representation of expression sub-nodes. Internally this method creates another ExpressionParts object callse it's buildExpressionParts to build sub-node's parts then calls getExpressionStr method. This process can recurcively propagate down expression tree.

Parameters
node an expression sub-node
Returns
  • a sub-node string representation

protected String getTupleStr (WebOperatorNode node)

A helper method used to build a tuple string representation

Parameters
node a sub-node representing a tuple

protected void logWarning (String message)

A helper method that logs warnings

protected ExpressionStringsImpl newExpressionParts (WebNode node)

A helper factory method that creates new ExpressionParts instances for the getNodeStr(WebNode) method. This implementation creates instancess of the ExpressionPartsImpl class. Override this method to use custom ExpressionParts objects