Package org.kuali.rice.krad.uif.util
Class ObjectPathExpressionParser
java.lang.Object
org.kuali.rice.krad.uif.util.ObjectPathExpressionParser
Provides modular support parsing path expressions using Spring's BeanWrapper expression Syntax.
(see The Spring Manual)
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacePath entry interface for use withparsePathExpression(Object, String, PathEntry). -
Method Summary
Modifier and TypeMethodDescriptionstatic intindexOfCloseBracket(String path, int leftBracketIndex) Return the index of the close bracket that matches the bracket at the start of the path.static booleanDetermine if a property name is a path or a plain property reference.static <T> TparsePathExpression(Object root, String path, ObjectPathExpressionParser.PathEntry pathEntry) Parse a path expression.
-
Method Details
-
indexOfCloseBracket
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
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:
-