Package org.apache.juneau.rest.guard
Class RoleMatcher
java.lang.Object
org.apache.juneau.rest.guard.RoleMatcher
Utility class for matching JEE user roles against string expressions.
 
Supports the following expression constructs:
- "foo" - Single arguments.
- "foo,bar,baz" - Multiple OR'ed arguments.
- "foo | bar | bqz" - Multiple OR'ed arguments, pipe syntax.
- "foo || bar || bqz" - Multiple OR'ed arguments, Java-OR syntax.
- "fo*" - Patterns including- '*' and- '?' .
- "fo* & *oo" - Multiple AND'ed arguments, ampersand syntax.
- "fo* && *oo" - Multiple AND'ed arguments, Java-AND syntax.
- "fo* || (*oo || bar)" - Parenthesis.
Notes:
- AND operations take precedence over OR operations (as expected).
- Whitespace is ignored.
- null or empty expressions always match as- false .
See Also:
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
RoleMatcherConstructor.- Parameters:
- expression- The string expression.
- Throws:
- ParseException- If the expression is malformed.
 
 
- 
- 
Method Details- 
matchesReturnstrue if the specified string matches this expression.- Parameters:
- roles- The user roles.
- Returns:
- true if the specified string matches this expression.
 Always- false if the string is- null .
 
- 
toString
- 
getRolesInExpressionReturns all the tokens used in this expression.- Returns:
- All the tokens used in this expression.
 
 
-