Class ObjectPathExpressionParser

java.lang.Object
org.kuali.rice.krad.uif.util.ObjectPathExpressionParser

public final class ObjectPathExpressionParser extends Object
Provides modular support parsing path expressions using Spring's BeanWrapper expression Syntax. (see The Spring Manual)
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Method Details

    • indexOfCloseBracket

      public static int indexOfCloseBracket(String path, int leftBracketIndex)
      Return the index of the close bracket that matches the bracket at the start of the path.
      Parameters:
      path - The string to scan.
      leftBracketIndex - The index of the left bracket.
      Returns:
      The index of the right bracket that matches the left bracket at index given. If the path does not begin with an open bracket, then -1 is returned.
    • isPath

      public static boolean isPath(String propertyName)
      Determine if a property name is a path or a plain property reference.

      This method is used to eliminate parsing and object creation overhead when resolving an object property reference with a non-complex property path.

      Parameters:
      propertyName - property name
      Returns:
      true if the name is a path, false if a plain reference
    • parsePathExpression

      public static <T> T parsePathExpression(Object root, String path, ObjectPathExpressionParser.PathEntry pathEntry)
      Parse a path expression.
      Parameters:
      root - The root object.
      path - The path expression.
      pathEntry - The path entry adaptor to use for processing parse node transition.
      Returns:
      The valid of the bean property indicated by the given path expression, null if the path expression doesn't resolve to a valid property.
      See Also: