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 Details

    • ATTRIBUTE_DESC

      private static final String ATTRIBUTE_DESC
      Regular expression that matches an attribute description.
      See Also:
    • ASSERTION_VALUE

      private static final String ASSERTION_VALUE
      Regular expression that matches an assertion value.
      See Also:
    • ESCAPE_CHARS_PATTERN

      private static final Pattern ESCAPE_CHARS_PATTERN
      Regular expression that matches characters that should have been escaped.
    • PRESENCE_FILTER_PATTERN

      private static final Pattern PRESENCE_FILTER_PATTERN
      Regex pattern to match a presence filter.
    • EQUALITY_FILTER_PATTERN

      private static final Pattern EQUALITY_FILTER_PATTERN
      Regex pattern to match an equality filter.
    • SUBSTRING_FILTER_PATTERN

      private static final Pattern SUBSTRING_FILTER_PATTERN
      Regex pattern to match a substring filter.
    • EXTENSIBLE_FILTER_PATTERN

      private static final Pattern EXTENSIBLE_FILTER_PATTERN
      Regex pattern to match an extensible filter.
    • GREATER_OR_EQUAL_FILTER_PATTERN

      private static final Pattern GREATER_OR_EQUAL_FILTER_PATTERN
      Regex pattern to match a greater or equal filter.
    • LESS_OR_EQUAL_FILTER_PATTERN

      private static final Pattern LESS_OR_EQUAL_FILTER_PATTERN
      Regex pattern to match a less or equal filter.
    • APPROXIMATE_FILTER_PATTERN

      private static final Pattern APPROXIMATE_FILTER_PATTERN
      Regex pattern to match an approximate filter.
  • Constructor Details

    • RegexFilterFunction

      public RegexFilterFunction()
  • Method Details

    • parseFilterComp

      protected Filter parseFilterComp(String filter) throws FilterParseException
      Description copied from class: AbstractFilterFunction
      Inspects the supplied filter string and creates the type of filter it represents.
      Specified by:
      parseFilterComp in class AbstractFilterFunction
      Parameters:
      filter - to inspect
      Returns:
      search filter
      Throws:
      FilterParseException - if filter is invalid
    • parsePresenceFilter

      static 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
    • parseEqualityFilter

      static 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
    • parseSubstringFilter

      static 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
    • parseExtensibleFilter

      static 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
    • parseGreaterOrEqualFilter

      static 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
    • parseLessOrEqualFilter

      static 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
    • parseApproximateFilter

      static 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
    • throwOnEscapeChars

      private static void throwOnEscapeChars(String... values) throws FilterParseException
      Throws an exception if the supplied value matches ESCAPE_CHARS_PATTERN.
      Parameters:
      values - to check
      Throws:
      FilterParseException - if a value contains characters that should be escaped