com.ibm.commerce.component.bod

Class VerbPathStep

  • java.lang.Object
    • com.ibm.commerce.component.bod.VerbPathStep


  • public class VerbPathStep
    extends java.lang.Object
    Represents a node in path. Each node is a Java object. A step has a nodeTest and a list of predicates. A nodeTest is the name that indicates the node of current step. A nodeTest is corresponding to a JavaBean-like property in parent object of the current step. For example, if the nodeTest is "item", and the parent object is order, then the corresponding getter will be order.getItem(). A step also has a list of VerbStepPredicate. Only the nodes that satisfy all the predicates are represented by the step. The value of each node is obtained by calling the method get() of the step's parent. For example, if a step's nodeTest is "giftItem", then the value of the node is retrieved by getGiftItem(). The getGiftItem(). is defined in the parent node of the current step.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASS_NAME
      Class name
      static java.lang.String COPYRIGHT
      IBM Copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      VerbPathStep(java.lang.String aNodeTest, VerbStepPredicate[] thePredicates)
      Constructs an instance of VerbPathStep
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object o) 
      java.lang.String getNodeTest() 
      java.util.List getPredicates() 
      java.lang.Object getValue(VerbPathContext context)
      This method gets the value of the node that this step is representing.
      int hashCode()
      Returns the hash code of an instance of this class
      boolean isNodeTest(java.lang.String pNodeTest)
      Determines if a given string is a NodeTest
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

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

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • CLASS_NAME

        public static final java.lang.String CLASS_NAME
        Class name
    • Constructor Detail

      • VerbPathStep

        public VerbPathStep(java.lang.String aNodeTest,
                            VerbStepPredicate[] thePredicates)
        Constructs an instance of VerbPathStep
        Parameters:
        aNodeTest - The nodeTest of the step. Each nodeTest is represented by a getter and a setter. For example, if we have getProperty() and setProperty(), then the nodeTest will be "property".
        thePredicates - The predicates that filter the matching steps
    • Method Detail

      • getNodeTest

        public java.lang.String getNodeTest()
        Returns:
        the nodeTest of this step
      • getValue

        public java.lang.Object getValue(VerbPathContext context)
        This method gets the value of the node that this step is representing.
        Parameters:
        context - the computation context for this step
        Returns:
        An object that is the value of the step
      • getPredicates

        public java.util.List getPredicates()
        Returns:
        the predicate of this step
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this step
      • isNodeTest

        public boolean isNodeTest(java.lang.String pNodeTest)
        Determines if a given string is a NodeTest
        Parameters:
        nodeTest - The nodeTest to be compared with
        Returns:
        true if the given nodeTest is the same as this step's nodeTest.
      • equals

        public final boolean equals(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - object
        Returns:
        true if the given object is a VerbPathStep, and it has the same predicates and the same nodeTest
      • hashCode

        public int hashCode()
        Returns the hash code of an instance of this class
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code of this instance