Class 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
    • Method Detail

      • buildExpressionParts

        public void buildExpressionParts​(WebNode node)
        Builds expression parts collection for a specified expression node.
        Specified by:
        buildExpressionParts in interface ExpressionStrings
        Parameters:
        node - expression node
      • getPart

        public java.lang.String getPart​(java.lang.String name)
        Description copied from interface: ExpressionStrings
        Returns specified expresson part or null if the part does not exist.
        Specified by:
        getPart in interface ExpressionStrings
        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: ExpressionStrings
        Sets specified part value
        Specified by:
        setPart in interface ExpressionStrings
        Parameters:
        name - a part name
        value - a part value
      • hasPart

        public boolean hasPart​(java.lang.String name)
        Description copied from interface: ExpressionStrings
        Returns true if the collection contains part with specified name
        Specified by:
        hasPart in interface ExpressionStrings
        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: ExpressionStrings
        Builds and returns user-friendly expression string from the expression parts
        Specified by:
        getExpressionStr in interface ExpressionStrings
        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)
      • 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 node
        operatorName - 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 node
        operatorName - 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 node
        operatorName - 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 node
        operatorName - 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 node
        operatorName - 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 node
        operatorName - 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
      • 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 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
      • 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:
        getConstNodeVal in interface ExpressionStrings
      • 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 key
        param - a string parameter
      • logWarning

        protected void logWarning​(java.lang.String message)
        A helper method that logs warnings