com.ibm.commerce.foundation.client.util.oagis

Class RelationalExpression

  • java.lang.Object
    • com.ibm.commerce.foundation.client.util.oagis.RelationalExpression
  • All Implemented Interfaces:
    java.lang.Cloneable


    public class RelationalExpression
    extends java.lang.Object
    implements java.lang.Cloneable
    This class stores an XPath relational expression. Relational expressions are used to provide additional control information for a request.

    The most common control parameters are Access profiles (_wcf.ap=IBM_Admin_Details) and data language Id (_wcf.dataLanguageIds='-1,-2'). The SelectionCriteriaHelper class helps construct a selection criteria expression with the Access profile and data language Id control parameters. Additional control parameters may be added to the expression using SelectionCriteriaHelper.addNameValuePair(RelationalExpression).

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright statement
      static java.lang.String STR_CONTAINS_OPERATOR
      'Contains' operator used between the operands of the XPath relational expression.
      static java.lang.String STR_ENDS_WITH_OPERATOR
      'ends-with' operator used between the operands of the XPath relational expression.
      static java.lang.String STR_EQ_OPERATOR
      'Equals' operator used between the operands of the XPath relational expression.
      static java.lang.String STR_GE_OPERATOR
      'Greater than or equals' operator used between the operands of the XPath relational expression.
      static java.lang.String STR_GT_OPERATOR
      'Greater than' operator used between the operands of the XPath relational expression.
      static java.lang.String STR_LE_OPERATOR
      'Less than or equals' operator used between the operands of the XPath relational expression.
      static java.lang.String STR_LT_OPERATOR
      'Less than' operator used between the operands of the XPath relational expression.
      static java.lang.String STR_NE_OPERATOR
      'Not equals' operator used between the operands of the XPath relational expression.
      static java.lang.String STR_STARTS_WITH_OPERATOR
      'starts-with' operator used between the operands of the XPath relational expression.
    • Constructor Summary

      Constructors 
      Constructor and Description
      RelationalExpression(RelationalExpression aRelExpr)
      Initializes a newly created RelationalExpression object so that it represents the same relational expression as the argument.
      RelationalExpression(java.lang.String astrName, java.util.List alValues)
      Construct a relational expression.
      RelationalExpression(java.lang.String astrName, java.util.List alValues, java.lang.String astrOperator)
      Construct a relational expression.
      RelationalExpression(java.lang.String astrName, java.lang.String astrValue)
      Construct a relational expression.
      RelationalExpression(java.lang.String astrName, java.lang.String astrValue, java.lang.String astrOperator)
      Construct a relational expression.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.StringBuffer appendQueryString(java.lang.StringBuffer asbBuffer, int additionalCapacity)
      Append a list of values of this relational expression as name-value pairs separated by a semi-colon to the specified buffer.
      java.lang.StringBuilder appendQueryStringBuilder(java.lang.StringBuilder asbBuffer, int additionalCapacity)
      Append a list of values of this relational expression as name-value pairs separated by a semi-colon to the specified buffer.
      java.lang.Object clone()
      Returns a clone of this object.
      boolean equals(RelationalExpression aRelExpr)
      Indicates whether some other RelationExpression object is "equal to" this one.
      java.lang.String getName()
      Get the name of the operand
      java.lang.String getOperator()
      Return the comparison operator.
      java.util.List getValues()
      Return the values of the operand
      void setName(java.lang.String name)
      Set the name of the operand
      void setOperator(java.lang.String operator)
      Sets comparison operator.
      void setValue(java.lang.String value)
      Sets the value of the operand
      java.lang.String toQueryString()
      Return a list of values of this relational expression as name-value pairs separated by a semi-colon.
      java.lang.String toString()
      Return string representation of this relational expression.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright statement
        See Also:
        Constant Field Values
      • STR_CONTAINS_OPERATOR

        public static final java.lang.String STR_CONTAINS_OPERATOR
        'Contains' operator used between the operands of the XPath relational expression. E.g., contains(description, "colour")
        See Also:
        Constant Field Values
      • STR_STARTS_WITH_OPERATOR

        public static final java.lang.String STR_STARTS_WITH_OPERATOR
        'starts-with' operator used between the operands of the XPath relational expression. E.g., starts-with(description, "colour")
        See Also:
        Constant Field Values
      • STR_ENDS_WITH_OPERATOR

        public static final java.lang.String STR_ENDS_WITH_OPERATOR
        'ends-with' operator used between the operands of the XPath relational expression. E.g., ends-with(description, "colour")
        See Also:
        Constant Field Values
      • STR_EQ_OPERATOR

        public static final java.lang.String STR_EQ_OPERATOR
        'Equals' operator used between the operands of the XPath relational expression. E.g., a=1
        See Also:
        Constant Field Values
      • STR_LT_OPERATOR

        public static final java.lang.String STR_LT_OPERATOR
        'Less than' operator used between the operands of the XPath relational expression. E.g., a<1
        See Also:
        Constant Field Values
      • STR_GT_OPERATOR

        public static final java.lang.String STR_GT_OPERATOR
        'Greater than' operator used between the operands of the XPath relational expression. E.g., a>=1
        See Also:
        Constant Field Values
      • STR_LE_OPERATOR

        public static final java.lang.String STR_LE_OPERATOR
        'Less than or equals' operator used between the operands of the XPath relational expression. E.g., a<=1
        See Also:
        Constant Field Values
      • STR_GE_OPERATOR

        public static final java.lang.String STR_GE_OPERATOR
        'Greater than or equals' operator used between the operands of the XPath relational expression. E.g., a>=1
        See Also:
        Constant Field Values
      • STR_NE_OPERATOR

        public static final java.lang.String STR_NE_OPERATOR
        'Not equals' operator used between the operands of the XPath relational expression. E.g., a!=1
        See Also:
        Constant Field Values
    • Constructor Detail

      • RelationalExpression

        public RelationalExpression(java.lang.String astrName,
                                    java.lang.String astrValue,
                                    java.lang.String astrOperator)
        Construct a relational expression.
        Parameters:
        astrName - - operand name
        astrValue - - operand value
        astrOperator - - comparison operator
      • RelationalExpression

        public RelationalExpression(java.lang.String astrName,
                                    java.util.List alValues,
                                    java.lang.String astrOperator)
        Construct a relational expression.
        Parameters:
        astrName - - operand name
        alValues - - list of String values
        astrOperator - - comparison operator
      • RelationalExpression

        public RelationalExpression(java.lang.String astrName,
                                    java.lang.String astrValue)
        Construct a relational expression.
        Parameters:
        astrName - - operand name
        astrValue - - operand value Default operator is '='.
      • RelationalExpression

        public RelationalExpression(java.lang.String astrName,
                                    java.util.List alValues)
        Construct a relational expression.
        Parameters:
        astrName - - operand name
        alValues - - list of String values Default operator is '='.
      • RelationalExpression

        public RelationalExpression(RelationalExpression aRelExpr)
        Initializes a newly created RelationalExpression object so that it represents the same relational expression as the argument. In other words, the newly created relational expression is a copy of the argument relational expression.
        Parameters:
        aRelExpr - - relational expression
    • Method Detail

      • clone

        public java.lang.Object clone()
        Returns a clone of this object. Modifications made to the returned clone do not affect this object.
        Overrides:
        clone in class java.lang.Object
        Returns:
        a clone of this object.
        See Also:
        Cloneable
      • getName

        public final java.lang.String getName()
        Get the name of the operand
        Returns:
        The name of the operand
      • getValues

        public final java.util.List getValues()
        Return the values of the operand
        Returns:
        list of String values
      • getOperator

        public final java.lang.String getOperator()
        Return the comparison operator.
        Returns:
        The comparison operator
      • setName

        public final void setName(java.lang.String name)
        Set the name of the operand
        Parameters:
        name - The name of the operand
      • setOperator

        public final void setOperator(java.lang.String operator)
        Sets comparison operator.
        Parameters:
        operator - The comparison operator
      • setValue

        public final void setValue(java.lang.String value)
        Sets the value of the operand
        Parameters:
        value - The value of the relational expression
      • toString

        public java.lang.String toString()
        Return string representation of this relational expression.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string object in the form name operator [value1,value2,...]
      • appendQueryStringBuilder

        public final java.lang.StringBuilder appendQueryStringBuilder(java.lang.StringBuilder asbBuffer,
                                                                      int additionalCapacity)
        Append a list of values of this relational expression as name-value pairs separated by a semi-colon to the specified buffer. Calling this method is equivalent to calling asbBuffer.append(this.toQueryString()).
        Parameters:
        asbBuffer - the buffer. If this is null, a new buffer is created and returned.
        additionalCapacity - the buffer returned will have at least the specified additonal capacity.
        Returns:
        the buffer.
      • appendQueryString

        public final java.lang.StringBuffer appendQueryString(java.lang.StringBuffer asbBuffer,
                                                              int additionalCapacity)
        Append a list of values of this relational expression as name-value pairs separated by a semi-colon to the specified buffer. Calling this method is equivalent to calling asbBuffer.append(this.toQueryString()).
        Parameters:
        asbBuffer - the buffer. If this is null, a new buffer is created and returned.
        additionalCapacity - the buffer returned will have at least the specified additonal capacity.
        Returns:
        the buffer.
      • toQueryString

        public java.lang.String toQueryString()
        Return a list of values of this relational expression as name-value pairs separated by a semi-colon.
        Returns:
        a string of name-value pairs separated by a semi-colon
      • equals

        public boolean equals(RelationalExpression aRelExpr)
        Indicates whether some other RelationExpression object is "equal to" this one. The RelationExpression objects are equal under the following conditions:
        • The name of the operands are equal
        • The comparison operators are equal
        • The values of the operands are equal
        Parameters:
        aRelExpr - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.