com.ibm.commerce.component.bod

Class VerbPathContext

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


  • public class VerbPathContext
    extends java.lang.Object
    A VerbPathContext provides an evaluation context for evaluating a VerbPath, such as the starting node of a path. It also provides APIs that traverse a graph of Javabean-like objects. The current supported traverse is linear and top-down. That is, each VerbPathStep represents one and only one node in a graph, and VerbPath can not back-track. Each node in the graph that is to be traversed should have getters and setters. only the attributes that have getters will be retrieved while a path is being evaluated.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASS_NAME
      Name of this class
      static java.lang.String COPYRIGHT
      IBM Copyright
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean endsWith(VerbPath path, java.lang.Object lastElement, java.lang.String attribute)
      Checks if a given verb path ends with a given node that has the given attribute
      java.lang.Object getValue(VerbPath path)
      Gets the value based on the given verb path within this context
      static VerbPathContext newContext(java.lang.Object aContextBean)
      Instantiates a VerbPathContext instance
      • Methods inherited from class java.lang.Object

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

      • COPYRIGHT

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

        public static final java.lang.String CLASS_NAME
        Name of this class
    • Method Detail

      • newContext

        public static VerbPathContext newContext(java.lang.Object aContextBean)
        Instantiates a VerbPathContext instance
        Parameters:
        aContextBean - the starting point of a verb path. This object should have getters and setters that are conform to JavaBean standards
        Returns:
        a new instance of VerbPathContext
      • getValue

        public java.lang.Object getValue(VerbPath path)
        Gets the value based on the given verb path within this context
        Parameters:
        path - the path on which the traversal of graph is performed
        Returns:
        the value led by the given path
      • endsWith

        public boolean endsWith(VerbPath path,
                                java.lang.Object lastElement,
                                java.lang.String attribute)
        Checks if a given verb path ends with a given node that has the given attribute
        Parameters:
        path -
        lastElement -
        attribute -
        Returns:
        true if a path ends with lastElement.getAttribute()