
Public Member Functions | |
| ERXBooleanExpressionParser (String expression) | |
| boolean | evaluateWithObject (NSKeyValueCodingAdditions valueProvider) |
| EOQualifier | qualifier () |
| String | toDebugString () |
| String | toString () |
Private Member Functions | |
| boolean | isBooleanWordToken (String token) |
| String | qualifierFormatForBooleanExpression () |
Private Attributes | |
| EOQualifier | _qualifier |
| String | _qualifierFormatForBooleanExpression |
| final String | expression |
Static Private Attributes | |
| static final String[] | BOOLEAN_WORDS = new String[] { "AND", "OR", "NOT" } |
| static Pattern | KEYPATH_TOKEN_PATTERN = Pattern.compile("\\w+([.]\\w*)*") |
The valueProvider object must implement NSKeyValueCodingAdditions interface.
Acceptable boolean expressions can use the words AND, OR and NOT in upper, lower or mixed case. Parentheses can be used as needed to group elements of the expression.
Variable symbols in the boolean expression can use characters and formatting of typical keys or keyPaths.
All other words besides AND, OR and NOT are assumed to be variables (aka keyPaths) which resolve to Boolean values when valueForKeyPath is invoked on the valueProvider object (which can be a NSDictionary of variable values or any object that implements NSKeyValueCodingAdditions)
For example Expression: (canViewPerson AND canEditPerson) OR (isTheBoss AND NOT account.isAccountDisabled)
| ERXBooleanExpressionParser | ( | String | expression | ) |
| boolean evaluateWithObject | ( | NSKeyValueCodingAdditions | valueProvider | ) |
| boolean isBooleanWordToken | ( | String | token | ) | [private] |
| EOQualifier qualifier | ( | ) |
| String qualifierFormatForBooleanExpression | ( | ) | [private] |
| String toDebugString | ( | ) |
| String toString | ( | ) |
EOQualifier _qualifier [private] |
String _qualifierFormatForBooleanExpression [private] |
final String [] BOOLEAN_WORDS = new String[] { "AND", "OR", "NOT" } [static, private] |
final String expression [private] |
Pattern KEYPATH_TOKEN_PATTERN = Pattern.compile("\\w+([.]\\w*)*") [static, private] |
1.5.8