Package com.microstrategy.web.transform
Class ExpressionStringsImpl
- java.lang.Object
 - 
- com.microstrategy.web.transform.ExpressionStringsImpl
 
 
- 
- All Implemented Interfaces:
 ExpressionStrings
- Direct Known Subclasses:
 ExpressionPartsImpl
public class ExpressionStringsImpl extends java.lang.Object implements ExpressionStrings
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.- Since:
 - MicroStrategy Web 9.0.0
 
 
- 
- 
Field Summary
- 
Fields inherited from interface com.microstrategy.web.transform.ExpressionStrings
BANDING_SEPARATOR, PART_ATTR_FORM, PART_BREAK_BY, PART_CANCELLED_PROMPT, PART_DORMANT_PROMPT, PART_EMBEDDED_PROMPT, PART_EXPRESSION, PART_LEFT_OPERAND, PART_OPERATOR, PART_OUTPUT_LEVEL, PART_RIGHT_OPERAND 
 - 
 
- 
Constructor Summary
Constructors Modifier Constructor Description ExpressionStringsImpl(ExpressionObject pOb)Constructs expression parts object for a specified expression object.ExpressionStringsImpl(ExpressionObject pOb, java.util.Locale locale)Constructs expression parts object for a specified expression object and a given localeprotectedExpressionStringsImpl(ExpressionStringsImpl parent)This constructor is used when a childExpressionPartsobject is used to build subexpression string. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddMrpPrefix(WebOperatorNode node)A helper method used to add rank/percent prefix to the left operand partprotected voidbuildAndOrOperatorParts(WebOperatorNode node, java.lang.String operatorName)A helper method used to build expression parts for infix operatorsprotected voidbuildBetweenOperatorParts(WebOperatorNode node, java.lang.String operatorName)A helper method used to build expression parts for BETWEEN operatorsprotected voidbuildBreakByPart(WebOperatorNode node)protected voidbuildDescendantsParts(WebOperatorNode node)protected java.lang.StringbuildDimtyStr(WebOperatorNode node)voidbuildExpressionParts(WebNode node)Builds expression parts collection for a specified expression node.protected voidbuildExprParts(WebOperatorNode node)A helper method called from the {link buildExpressionParts} to build expression parts for all expression types excluding rank and percent metric expressions.protected voidbuildFormShortcutParts(WebFormShortcutNode node)A helper method used to build expression parts (left operand and attribute form) for the form shortcut nodeprotected voidbuildFunction(WebOperatorNode node, java.lang.String functionName)A helper method used to build a tuple string representationprotected voidbuildInfixOperatorParts(WebOperatorNode node, java.lang.String operatorName)A helper method used to build expression parts for infix operatorsprotected voidbuildInOperatorParts(WebOperatorNode node, java.lang.String operatorName)A helper method used to build expression parts for IN operatorsprotected voidbuildLeftOperandFromOperator(WebOperatorNode node)A helper method called from thebuildLeftOperandParts(com.microstrategy.web.objects.WebOperatorNode)to build left operand parts in the case the left operand is an operator.protected voidbuildLeftOperandParts(WebOperatorNode node)A helper method used to build left operand partsprotected voidbuildMrpParts(WebOperatorNode node)A helper method called from thebuildExpressionParts(com.microstrategy.web.objects.WebNode)to build expression parts for rank and percent metric expressions.protected voidbuildOutputLevelPart(WebOperatorNode node)A helper method that builds and adds to the parts collection a dimensionality expression partprotected voidbuildPostfixOperatorParts(WebOperatorNode node, java.lang.String operatorName)A helper method used to build expression parts for postfix operatorsprotected voidbuildPrefixOperatorParts(WebOperatorNode node, java.lang.String operatorName)A helper method used to build expression parts for prefix operatorsjava.lang.StringgetConstNodeVal(WebNode node)A helper method that extracts value from the constant and time nodes.java.lang.StringgetExpressionStr()Builds and returns user-friendly expression string from the expression partsprotected java.lang.StringgetMessageStr(int key)A helper method that obtains a proper string from the resource bundleprotected java.lang.StringgetMessageStr(int key, java.lang.String param)A helper method that obtains a proper string from the resource bundle and replaces the "##" substring in it with the param valueprotected java.lang.StringgetNodeStr(WebNode node)A helper method used to build string representation of expression sub-nodes.java.lang.StringgetPart(java.lang.String name)Returns specified expresson part or null if the part does not exist.protected java.lang.StringgetTupleStr(WebOperatorNode node)A helper method used to build a tuple string representationbooleanhasPart(java.lang.String name)Returns true if the collection contains part with specified nameprotected voidlogWarning(java.lang.String message)A helper method that logs warningsprotected ExpressionStringsImplnewExpressionParts(WebNode node)A helper factory method that creates newExpressionPartsinstances for thegetNodeStr(com.microstrategy.web.objects.WebNode)method.static voidremoveThreadLocal()voidsetDataSets(RWDataSets value)voidsetPart(java.lang.String name, java.lang.String value)Sets specified part valuevoidsetShowDynamicDatesAsStatic(boolean val)voidsetUseMathOperators(boolean val)booleanshowDynamicDatesAsStatic()booleanuseMathOperators() 
 - 
 
- 
- 
Constructor Detail
- 
ExpressionStringsImpl
public ExpressionStringsImpl(ExpressionObject pOb)
Constructs expression parts object for a specified expression object. 
- 
ExpressionStringsImpl
public ExpressionStringsImpl(ExpressionObject pOb, java.util.Locale locale)
Constructs expression parts object for a specified expression object and a given locale 
- 
ExpressionStringsImpl
protected ExpressionStringsImpl(ExpressionStringsImpl parent)
This constructor is used when a childExpressionPartsobject is used to build subexpression string.- Parameters:
 parent- a parentExpressionPartsobjects- See Also:
 buildExpressionParts(com.microstrategy.web.objects.WebNode),newExpressionParts(com.microstrategy.web.objects.WebNode)
 
 - 
 
- 
Method Detail
- 
removeThreadLocal
public static void removeThreadLocal()
 
- 
buildExpressionParts
public void buildExpressionParts(WebNode node)
Builds expression parts collection for a specified expression node.- Specified by:
 buildExpressionPartsin interfaceExpressionStrings- Parameters:
 node- expression node
 
- 
getPart
public java.lang.String getPart(java.lang.String name)
Description copied from interface:ExpressionStringsReturns specified expresson part or null if the part does not exist.- Specified by:
 getPartin interfaceExpressionStrings- Parameters:
 name- a part name- Returns:
 - a part value
 
 
- 
setPart
public void setPart(java.lang.String name, java.lang.String value)Description copied from interface:ExpressionStringsSets specified part value- Specified by:
 setPartin interfaceExpressionStrings- Parameters:
 name- a part namevalue- a part value
 
- 
hasPart
public boolean hasPart(java.lang.String name)
Description copied from interface:ExpressionStringsReturns true if the collection contains part with specified name- Specified by:
 hasPartin interfaceExpressionStrings- Parameters:
 name- a part name- Returns:
 - true if the collection contains part with specified name
 
 
- 
getExpressionStr
public java.lang.String getExpressionStr()
Description copied from interface:ExpressionStringsBuilds and returns user-friendly expression string from the expression parts- Specified by:
 getExpressionStrin interfaceExpressionStrings- Returns:
 - name a part name
 
 
- 
useMathOperators
public boolean useMathOperators()
 
- 
setUseMathOperators
public void setUseMathOperators(boolean val)
 
- 
showDynamicDatesAsStatic
public boolean showDynamicDatesAsStatic()
 
- 
setShowDynamicDatesAsStatic
public void setShowDynamicDatesAsStatic(boolean val)
 
- 
buildMrpParts
protected void buildMrpParts(WebOperatorNode node)
A helper method called from thebuildExpressionParts(com.microstrategy.web.objects.WebNode)to build expression parts for rank and percent metric expressions.- Parameters:
 node- expression node
 
- 
addMrpPrefix
protected void addMrpPrefix(WebOperatorNode node)
A helper method used to add rank/percent prefix to the left operand part- Parameters:
 node- an expression node
 
- 
buildExprParts
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
 
- 
buildInfixOperatorParts
protected void buildInfixOperatorParts(WebOperatorNode node, java.lang.String operatorName)
A helper method used to build expression parts for infix operators- Parameters:
 node- operator nodeoperatorName- an operator name like "Grater then" or "+" and so on.
 
- 
buildAndOrOperatorParts
protected void buildAndOrOperatorParts(WebOperatorNode node, java.lang.String operatorName)
A helper method used to build expression parts for infix operators- Parameters:
 node- operator nodeoperatorName- an operator name like "Grater then" or "+" and so on.
 
- 
buildPrefixOperatorParts
protected void buildPrefixOperatorParts(WebOperatorNode node, java.lang.String operatorName)
A helper method used to build expression parts for prefix operators- Parameters:
 node- operator nodeoperatorName- an operator name like "Not" or "-" and so on.
 
- 
buildBetweenOperatorParts
protected void buildBetweenOperatorParts(WebOperatorNode node, java.lang.String operatorName)
A helper method used to build expression parts for BETWEEN operators- Parameters:
 node- operator nodeoperatorName- an operator name ("between" or "not between").
 
- 
buildInOperatorParts
protected void buildInOperatorParts(WebOperatorNode node, java.lang.String operatorName)
A helper method used to build expression parts for IN operators- Parameters:
 node- operator nodeoperatorName- an operator name ("in" or "not in").
 
- 
buildDescendantsParts
protected void buildDescendantsParts(WebOperatorNode node)
 
- 
buildPostfixOperatorParts
protected void buildPostfixOperatorParts(WebOperatorNode node, java.lang.String operatorName)
A helper method used to build expression parts for postfix operators- Parameters:
 node- operator nodeoperatorName- an operator name like "is null" and so on.
 
- 
buildLeftOperandParts
protected void buildLeftOperandParts(WebOperatorNode node)
A helper method used to build left operand parts- Parameters:
 node- an expression node
 
- 
buildLeftOperandFromOperator
protected void buildLeftOperandFromOperator(WebOperatorNode node)
A helper method called from thebuildLeftOperandParts(com.microstrategy.web.objects.WebOperatorNode)to build left operand parts in the case the left operand is an operator.- Parameters:
 node- a sub-node representing left operand
 
- 
buildFunction
protected void buildFunction(WebOperatorNode node, java.lang.String functionName)
A helper method used to build a tuple string representation- Parameters:
 node- a sub-node representing a tuple
 
- 
getTupleStr
protected java.lang.String getTupleStr(WebOperatorNode node)
A helper method used to build a tuple string representation- Parameters:
 node- a sub-node representing a tuple
 
- 
buildFormShortcutParts
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
 
- 
getNodeStr
protected java.lang.String getNodeStr(WebNode node)
A helper method used to build string representation of expression sub-nodes. Internally this method creates anotherExpressionPartsobject 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
 
 
- 
newExpressionParts
protected ExpressionStringsImpl newExpressionParts(WebNode node)
A helper factory method that creates newExpressionPartsinstances for thegetNodeStr(com.microstrategy.web.objects.WebNode)method. This implementation creates instancess of theExpressionPartsImplclass. Override this method to use customExpressionPartsobjects 
- 
buildOutputLevelPart
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
 
- 
buildBreakByPart
protected void buildBreakByPart(WebOperatorNode node)
 
- 
buildDimtyStr
protected java.lang.String buildDimtyStr(WebOperatorNode node)
 
- 
getConstNodeVal
public java.lang.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.- Specified by:
 getConstNodeValin interfaceExpressionStrings
 
- 
getMessageStr
protected java.lang.String getMessageStr(int key)
A helper method that obtains a proper string from the resource bundle- Parameters:
 key- a message key
 
- 
getMessageStr
protected java.lang.String getMessageStr(int key, java.lang.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 keyparam- a string parameter
 
- 
logWarning
protected void logWarning(java.lang.String message)
A helper method that logs warnings 
- 
setDataSets
public void setDataSets(RWDataSets value)
- Specified by:
 setDataSetsin interfaceExpressionStrings
 
 - 
 
 -