public class

SearchFilter

extends Object
implements AttrFilter
java.lang.Object
   ↳ com.sun.jndi.toolkit.dir.SearchFilter

Class Overview

A class for parsing LDAP search filters (defined in RFC 1960, 2254)

Summary

Constants
char AND_TOKEN
char APPROX_TOKEN
char BEGIN_FILTER_TOKEN
char END_FILTER_TOKEN
char EQUAL_TOKEN
char EXTEND_TOKEN
char GREATER_TOKEN
char LESS_TOKEN
char NOT_TOKEN
char OR_TOKEN
char WILDCARD_TOKEN
boolean debug
Public Constructors
SearchFilter(String filter)
Public Methods
boolean check(Attributes targetAttrs)
Determines whether an attribute passes the filter.
static int findUnescaped(char ch, String val, int start)
Finds the first occurrence of ch in val starting from position start.
static String format(Attributes attrs)
Creates an LDAP filter as a conjuction of the attributes supplied.
static String format(String expr, Object[] args)
Formats the expression expr using arguments from the array args.
static Attributes selectAttributes(Attributes originals, String[] attrIDs)
Protected Methods
void consumeChar()
void consumeChars(int i)
SearchFilter.StringFilter createNextFilter()
char getCurrentChar()
void normalizeFilter()
char relCharAt(int i)
int relIndexOf(int ch)
String relSubstring(int beginIndex, int endIndex)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.sun.jndi.toolkit.dir.AttrFilter

Constants

protected static final char AND_TOKEN

Constant Value: 38 (0x00000026)

protected static final char APPROX_TOKEN

Constant Value: 126 (0x0000007e)

protected static final char BEGIN_FILTER_TOKEN

Constant Value: 40 (0x00000028)

protected static final char END_FILTER_TOKEN

Constant Value: 41 (0x00000029)

protected static final char EQUAL_TOKEN

Constant Value: 61 (0x0000003d)

protected static final char EXTEND_TOKEN

Constant Value: 58 (0x0000003a)

protected static final char GREATER_TOKEN

Constant Value: 62 (0x0000003e)

protected static final char LESS_TOKEN

Constant Value: 60 (0x0000003c)

protected static final char NOT_TOKEN

Constant Value: 33 (0x00000021)

protected static final char OR_TOKEN

Constant Value: 124 (0x0000007c)

protected static final char WILDCARD_TOKEN

Constant Value: 42 (0x0000002a)

protected static final boolean debug

Constant Value: false

Public Constructors

public SearchFilter (String filter)

Public Methods

public boolean check (Attributes targetAttrs)

Determines whether an attribute passes the filter.

public static int findUnescaped (char ch, String val, int start)

Finds the first occurrence of ch in val starting from position start. It doesn't count if ch has been escaped by a backslash (\)

public static String format (Attributes attrs)

Creates an LDAP filter as a conjuction of the attributes supplied.

public static String format (String expr, Object[] args)

Formats the expression expr using arguments from the array args. {i} specifies the i'th element from the array args is to be substituted for the string "{i}". To escape '{' or '}' (or any other character), use '\'. Uses getEncodedStringRep() to do encoding.

public static Attributes selectAttributes (Attributes originals, String[] attrIDs)

Protected Methods

protected void consumeChar ()

protected void consumeChars (int i)

protected SearchFilter.StringFilter createNextFilter ()

protected char getCurrentChar ()

protected void normalizeFilter ()

protected char relCharAt (int i)

protected int relIndexOf (int ch)

protected String relSubstring (int beginIndex, int endIndex)