Package org.ldaptive.filter
Class RegexFilterFunction
java.lang.Object
org.ldaptive.filter.AbstractFilterFunction
org.ldaptive.filter.RegexFilterFunction
- All Implemented Interfaces:
FilterFunction
Parses an LDAP search filter string using regular expressions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Pattern
Regex pattern to match an approximate filter.private static final String
Regular expression that matches an assertion value.private static final String
Regular expression that matches an attribute description.private static final Pattern
Regex pattern to match an equality filter.private static final Pattern
Regular expression that matches characters that should have been escaped.private static final Pattern
Regex pattern to match an extensible filter.private static final Pattern
Regex pattern to match a greater or equal filter.private static final Pattern
Regex pattern to match a less or equal filter.private static final Pattern
Regex pattern to match a presence filter.private static final Pattern
Regex pattern to match a substring filter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static ApproximateFilter
parseApproximateFilter
(String component) Creates a new approximate filter by parsing the supplied filter string.(package private) static EqualityFilter
parseEqualityFilter
(String component) Creates a new equality filter by parsing the supplied filter string.(package private) static ExtensibleFilter
parseExtensibleFilter
(String component) Creates a new extensible filter by parsing the supplied filter string.protected Filter
parseFilterComp
(String filter) Inspects the supplied filter string and creates the type of filter it represents.(package private) static GreaterOrEqualFilter
parseGreaterOrEqualFilter
(String component) Creates a new greater or equal filter by parsing the supplied filter string.(package private) static LessOrEqualFilter
parseLessOrEqualFilter
(String component) Creates a new less or equal filter by parsing the supplied filter string.(package private) static PresenceFilter
parsePresenceFilter
(String component) Creates a new presence filter by parsing the supplied filter string.(package private) static SubstringFilter
parseSubstringFilter
(String component) Creates a new substring filter by parsing the supplied filter string.private static void
throwOnEscapeChars
(String... values) Throws an exception if the supplied value matchesESCAPE_CHARS_PATTERN
.Methods inherited from class org.ldaptive.filter.AbstractFilterFunction
parse
-
Field Details
-
ATTRIBUTE_DESC
Regular expression that matches an attribute description.- See Also:
-
ASSERTION_VALUE
Regular expression that matches an assertion value.- See Also:
-
ESCAPE_CHARS_PATTERN
Regular expression that matches characters that should have been escaped. -
PRESENCE_FILTER_PATTERN
Regex pattern to match a presence filter. -
EQUALITY_FILTER_PATTERN
Regex pattern to match an equality filter. -
SUBSTRING_FILTER_PATTERN
Regex pattern to match a substring filter. -
EXTENSIBLE_FILTER_PATTERN
Regex pattern to match an extensible filter. -
GREATER_OR_EQUAL_FILTER_PATTERN
Regex pattern to match a greater or equal filter. -
LESS_OR_EQUAL_FILTER_PATTERN
Regex pattern to match a less or equal filter. -
APPROXIMATE_FILTER_PATTERN
Regex pattern to match an approximate filter.
-
-
Constructor Details
-
RegexFilterFunction
public RegexFilterFunction()
-
-
Method Details
-
parseFilterComp
Description copied from class:AbstractFilterFunction
Inspects the supplied filter string and creates the type of filter it represents.- Specified by:
parseFilterComp
in classAbstractFilterFunction
- Parameters:
filter
- to inspect- Returns:
- search filter
- Throws:
FilterParseException
- if filter is invalid
-
parsePresenceFilter
Creates a new presence filter by parsing the supplied filter string.- Parameters:
component
- to parse- Returns:
- presence filter or null if component doesn't match this filter type
-
parseEqualityFilter
Creates a new equality filter by parsing the supplied filter string.- Parameters:
component
- to parse- Returns:
- equality filter or null if component doesn't match this filter type
- Throws:
FilterParseException
- if the filter is invalid
-
parseSubstringFilter
Creates a new substring filter by parsing the supplied filter string.- Parameters:
component
- to parse- Returns:
- substring filter or null if component doesn't match this filter type
- Throws:
FilterParseException
- if the filter contains values that should have been escaped
-
parseExtensibleFilter
Creates a new extensible filter by parsing the supplied filter string.- Parameters:
component
- to parse- Returns:
- extensible filter or null if component doesn't match this filter type
- Throws:
FilterParseException
- if the component cannot be parsed
-
parseGreaterOrEqualFilter
Creates a new greater or equal filter by parsing the supplied filter string.- Parameters:
component
- to parse- Returns:
- greater or equal filter or null if component doesn't match this filter type
- Throws:
FilterParseException
- if the component cannot be parsed
-
parseLessOrEqualFilter
Creates a new less or equal filter by parsing the supplied filter string.- Parameters:
component
- to parse- Returns:
- less or equal filter or null if component doesn't match this filter type
- Throws:
FilterParseException
- if the component cannot be parsed
-
parseApproximateFilter
Creates a new approximate filter by parsing the supplied filter string.- Parameters:
component
- to parse- Returns:
- approximate filter or null if component doesn't match this filter type
- Throws:
FilterParseException
- if the component cannot be parsed
-
throwOnEscapeChars
Throws an exception if the supplied value matchesESCAPE_CHARS_PATTERN
.- Parameters:
values
- to check- Throws:
FilterParseException
- if a value contains characters that should be escaped
-