Class AbstractExpressionTransform
- java.lang.Object
-
- com.microstrategy.web.transform.AbstractTransform
-
- com.microstrategy.web.app.transforms.AbstractExpressionTransform
-
- All Implemented Interfaces:
ExpressionMessages
,Transform
- Direct Known Subclasses:
ExpressionFilterTransform
,ExpressionPlainTextTransform
,PromptExpressionTransform
public abstract class AbstractExpressionTransform extends AbstractTransform implements ExpressionMessages
A base class for expression transforms. It proviedes a set of protected helper methods for building expression GUI.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description protected ExpressionObject
exprOb
A reference to the expression object being transformed-
Fields inherited from interface com.microstrategy.web.app.transforms.ExpressionMessages
DM_DEFAULT_LVL, DM_PREF_BREAKBY, DM_PREF_EVALSET, DM_PREF_SETOF, DM_RPT_BASE_LVL, DM_RPT_LVL, DM_UNKNOWN_LVL, DM_WHERE, FN_APPLY_AGGREGATION, FN_APPLY_COMPARISON, FN_APPLY_LOGIC, FN_APPLY_RELATIVE, FN_APPLY_SYMPLE, MRP_BETWEEN, MRP_EQUAL, MRP_EXCL_HIGHEST, MRP_EXCL_LOWEST, MRP_HIGHEST, MRP_LOWEST, MRP_NOT_BETWEEN, MRP_NOT_EQUAL, MRP_PERCENT, MRP_PERCENT_TEMPLATE, MRP_RANK, MRP_RANK_TEMPLATE, OP_AND, OP_BEGINS_WITH, OP_BETWEEN, OP_CONTAINS, OP_DIVIDE, OP_ENDS_WITH, OP_EQUAL, OP_GREATER, OP_GREATER_EQUAL, OP_IN, OP_IN_LIST, OP_IS_NOT_NULL, OP_IS_NULL, OP_LESS, OP_LESS_EQUAL, OP_LIKE, OP_MINUS, OP_NOT, OP_NOT_BEGINS_WITH, OP_NOT_BETWEEN, OP_NOT_CONTAINS, OP_NOT_ENDS_WITH, OP_NOT_EQUAL, OP_NOT_IN, OP_NOT_IN_LIST, OP_NOT_LIKE, OP_OR, OP_PLUS, OP_TIMES
-
-
Constructor Summary
Constructors Constructor Description AbstractExpressionTransform()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doTransform(MarkupOutput transOut)
Override this method (not the transform method)to do the real transform jobprotected ExpressionParts
getExpressionParts(WebNode node)
Creates and populates (@link ExpressionParts object for a specified operator node.protected java.lang.String
getExpressionStr(WebNode node)
Builds a user-friendly string representation of an expression represented by the (@link node}.java.lang.Class
getSupportedBeanType()
function that returns an instance of Class defining this implementation.protected ExpressionParts
newExpressionParts(WebNode node)
Creates a new instance ofExpressionParts
object.void
setShowDynamicDatesAsStatic(boolean val)
Sets the flag that indicates whether dynamic dates should be shown as dynamic or static.void
setUseMathOperators(boolean val)
Sets the flag indicating that the short (mathematical) form of comparison operators shall be used instead of long form.boolean
showDynamicDatesAsStatic()
Returns true if the dynamic form of dynamic dates in the expression shall be used instead of the static form.void
transform(Transformable data, MarkupOutput transOut)
This implementation of theTransform
interface method stores the passed expression object in the member variable, then calls thedoTransform(com.microstrategy.web.beans.MarkupOutput)
method.boolean
useMathOperators()
Returns true if the short (mathematical) form of comparison operators shall be used instead of long form.-
Methods inherited from class com.microstrategy.web.transform.AbstractTransform
addFormalParam, canTransform, getEvents, getFormalParams, getID, getPreview, isPreviewAvailable, isResolved, removeFormalParam, setAnnotation, setDeprecated, supports, supports
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.transform.Transform
getDescription
-
-
-
-
Field Detail
-
exprOb
protected ExpressionObject exprOb
A reference to the expression object being transformed
-
-
Method Detail
-
getSupportedBeanType
public java.lang.Class getSupportedBeanType()
function that returns an instance of Class defining this implementation.- Specified by:
getSupportedBeanType
in interfaceTransform
- Returns:
- Class instance of this class
-
transform
public void transform(Transformable data, MarkupOutput transOut) throws java.lang.ClassCastException
This implementation of theTransform
interface method stores the passed expression object in the member variable, then calls thedoTransform(com.microstrategy.web.beans.MarkupOutput)
method.- Specified by:
transform
in interfaceTransform
- Parameters:
data
- an object to transform. It must be of WebExpression type or ClassCastExcetption will be throwntransOut
- the MarkupOutput object where the transform result will be added.- Throws:
java.lang.ClassCastException
- if data is of the wrong type.
-
doTransform
protected abstract void doTransform(MarkupOutput transOut)
Override this method (not the transform method)to do the real transform job- Parameters:
transOut
- where to write output
-
getExpressionParts
protected ExpressionParts getExpressionParts(WebNode node)
Creates and populates (@link ExpressionParts object for a specified operator node.- Parameters:
node
- a node used to populate expression parts object- Returns:
- expression parts collection
-
getExpressionStr
protected java.lang.String getExpressionStr(WebNode node)
Builds a user-friendly string representation of an expression represented by the (@link node}.- Parameters:
node
- an operator node- Returns:
- a user-friendly string representation of an expression represented by the (@link node}.
-
useMathOperators
public boolean useMathOperators()
Returns true if the short (mathematical) form of comparison operators shall be used instead of long form. For example the ">" operator will be used instead of "grater" word.- Returns:
- true if the short (mathematical) form of comparison operators shall be used instead of long form.
-
setUseMathOperators
public void setUseMathOperators(boolean val)
Sets the flag indicating that the short (mathematical) form of comparison operators shall be used instead of long form.- Parameters:
val
- the flag value
-
newExpressionParts
protected ExpressionParts newExpressionParts(WebNode node)
Creates a new instance ofExpressionParts
object. This implementation creates an istance ofExpressionPartsImpl
object. Override this method if you wont to use a customExpressionParts
implementaion.- Parameters:
node
- where to extract expression parts from- Returns:
- a new instance of
ExpressionParts
object.
-
showDynamicDatesAsStatic
public boolean showDynamicDatesAsStatic()
Returns true if the dynamic form of dynamic dates in the expression shall be used instead of the static form.- Returns:
- true if dynamic dates will be shown as dynamic, false if they are shown as static.
- Since:
- MicroStrategy Web 8.0.2
-
setShowDynamicDatesAsStatic
public void setShowDynamicDatesAsStatic(boolean val)
Sets the flag that indicates whether dynamic dates should be shown as dynamic or static.- Parameters:
val
- The flag value.- Since:
- MicroStrategy Web 8.0.2
-
-