Package org.ldaptive.filter
Class RegexFilterFunction
- java.lang.Object
- 
- org.ldaptive.filter.AbstractFilterFunction
- 
- org.ldaptive.filter.RegexFilterFunction
 
 
- 
- All Implemented Interfaces:
- FilterFunction
 
 public class RegexFilterFunction extends AbstractFilterFunction Parses an LDAP search filter string using regular expressions.
- 
- 
Field SummaryFields Modifier and Type Field Description private static PatternAPPROXIMATE_FILTER_PATTERNRegex pattern to match an approximate filter.private static StringASSERTION_VALUERegular expression that matches an assertion value.private static StringATTRIBUTE_DESCRegular expression that matches an attribute description.private static PatternEQUALITY_FILTER_PATTERNRegex pattern to match an equality filter.private static PatternESCAPE_CHARS_PATTERNRegular expression that matches characters that should have been escaped.private static PatternEXTENSIBLE_FILTER_PATTERNRegex pattern to match an extensible filter.private static PatternGREATER_OR_EQUAL_FILTER_PATTERNRegex pattern to match a greater or equal filter.private static PatternLESS_OR_EQUAL_FILTER_PATTERNRegex pattern to match a less or equal filter.private static PatternPRESENCE_FILTER_PATTERNRegex pattern to match a presence filter.private static PatternSUBSTRING_FILTER_PATTERNRegex pattern to match a substring filter.
 - 
Constructor SummaryConstructors Constructor Description RegexFilterFunction()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static ApproximateFilterparseApproximateFilter(String component)Creates a new approximate filter by parsing the supplied filter string.(package private) static EqualityFilterparseEqualityFilter(String component)Creates a new equality filter by parsing the supplied filter string.(package private) static ExtensibleFilterparseExtensibleFilter(String component)Creates a new extensible filter by parsing the supplied filter string.protected FilterparseFilterComp(String filter)Inspects the supplied filter string and creates the type of filter it represents.(package private) static GreaterOrEqualFilterparseGreaterOrEqualFilter(String component)Creates a new greater or equal filter by parsing the supplied filter string.(package private) static LessOrEqualFilterparseLessOrEqualFilter(String component)Creates a new less or equal filter by parsing the supplied filter string.(package private) static PresenceFilterparsePresenceFilter(String component)Creates a new presence filter by parsing the supplied filter string.(package private) static SubstringFilterparseSubstringFilter(String component)Creates a new substring filter by parsing the supplied filter string.private static voidthrowOnEscapeChars(String... values)Throws an exception if the supplied value matchesESCAPE_CHARS_PATTERN.- 
Methods inherited from class org.ldaptive.filter.AbstractFilterFunctionparse
 
- 
 
- 
- 
- 
Field Detail- 
ATTRIBUTE_DESCprivate static final String ATTRIBUTE_DESC Regular expression that matches an attribute description.- See Also:
- Constant Field Values
 
 - 
ASSERTION_VALUEprivate static final String ASSERTION_VALUE Regular expression that matches an assertion value.- See Also:
- Constant Field Values
 
 - 
ESCAPE_CHARS_PATTERNprivate static final Pattern ESCAPE_CHARS_PATTERN Regular expression that matches characters that should have been escaped.
 - 
PRESENCE_FILTER_PATTERNprivate static final Pattern PRESENCE_FILTER_PATTERN Regex pattern to match a presence filter.
 - 
EQUALITY_FILTER_PATTERNprivate static final Pattern EQUALITY_FILTER_PATTERN Regex pattern to match an equality filter.
 - 
SUBSTRING_FILTER_PATTERNprivate static final Pattern SUBSTRING_FILTER_PATTERN Regex pattern to match a substring filter.
 - 
EXTENSIBLE_FILTER_PATTERNprivate static final Pattern EXTENSIBLE_FILTER_PATTERN Regex pattern to match an extensible filter.
 - 
GREATER_OR_EQUAL_FILTER_PATTERNprivate static final Pattern GREATER_OR_EQUAL_FILTER_PATTERN Regex pattern to match a greater or equal filter.
 - 
LESS_OR_EQUAL_FILTER_PATTERNprivate static final Pattern LESS_OR_EQUAL_FILTER_PATTERN Regex pattern to match a less or equal filter.
 - 
APPROXIMATE_FILTER_PATTERNprivate static final Pattern APPROXIMATE_FILTER_PATTERN Regex pattern to match an approximate filter.
 
- 
 - 
Method Detail- 
parseFilterCompprotected Filter parseFilterComp(String filter) throws FilterParseException Description copied from class:AbstractFilterFunctionInspects the supplied filter string and creates the type of filter it represents.- Specified by:
- parseFilterCompin class- AbstractFilterFunction
- Parameters:
- filter- to inspect
- Returns:
- search filter
- Throws:
- FilterParseException- if filter is invalid
 
 - 
parsePresenceFilterstatic PresenceFilter parsePresenceFilter(String component) 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
 
 - 
parseEqualityFilterstatic EqualityFilter parseEqualityFilter(String component) throws FilterParseException 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
 
 - 
parseSubstringFilterstatic SubstringFilter parseSubstringFilter(String component) throws FilterParseException 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
 
 - 
parseExtensibleFilterstatic ExtensibleFilter parseExtensibleFilter(String component) throws FilterParseException 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
 
 - 
parseGreaterOrEqualFilterstatic GreaterOrEqualFilter parseGreaterOrEqualFilter(String component) throws FilterParseException 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
 
 - 
parseLessOrEqualFilterstatic LessOrEqualFilter parseLessOrEqualFilter(String component) throws FilterParseException 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
 
 - 
parseApproximateFilterstatic ApproximateFilter parseApproximateFilter(String component) throws FilterParseException 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
 
 - 
throwOnEscapeCharsprivate static void throwOnEscapeChars(String... values) throws FilterParseException 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
 
 
- 
 
-