aicas logo Jamaica 3.4 release 8

com.sun.jndi.toolkit.dir
Class SearchFilter

java.lang.Object
  extended by com.sun.jndi.toolkit.dir.SearchFilter
All Implemented Interfaces:
AttrFilter

public class SearchFilter
extends Object
implements AttrFilter

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


Field Summary
protected static char AND_TOKEN
           
protected static char APPROX_TOKEN
           
protected static char BEGIN_FILTER_TOKEN
           
protected static boolean debug
           
protected static char END_FILTER_TOKEN
           
protected static char EQUAL_TOKEN
           
protected static char EXTEND_TOKEN
           
protected static char GREATER_TOKEN
           
protected static char LESS_TOKEN
           
protected static char NOT_TOKEN
           
protected static char OR_TOKEN
           
protected static char WILDCARD_TOKEN
           
 
Constructor Summary
SearchFilter(String filter)
           
 
Method Summary
 boolean check(Attributes targetAttrs)
          Determines whether an attribute passes the filter.
protected  void consumeChar()
           
protected  void consumeChars(int i)
           
protected  com.sun.jndi.toolkit.dir.SearchFilter.StringFilter createNextFilter()
           
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.
protected  char getCurrentChar()
           
protected  void normalizeFilter()
           
protected  char relCharAt(int i)
           
protected  int relIndexOf(int ch)
           
protected  String relSubstring(int beginIndex, int endIndex)
           
static Attributes selectAttributes(Attributes originals, String[] attrIDs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected static final boolean debug
See Also:
Constant Field Values

BEGIN_FILTER_TOKEN

protected static final char BEGIN_FILTER_TOKEN
See Also:
Constant Field Values

END_FILTER_TOKEN

protected static final char END_FILTER_TOKEN
See Also:
Constant Field Values

AND_TOKEN

protected static final char AND_TOKEN
See Also:
Constant Field Values

OR_TOKEN

protected static final char OR_TOKEN
See Also:
Constant Field Values

NOT_TOKEN

protected static final char NOT_TOKEN
See Also:
Constant Field Values

EQUAL_TOKEN

protected static final char EQUAL_TOKEN
See Also:
Constant Field Values

APPROX_TOKEN

protected static final char APPROX_TOKEN
See Also:
Constant Field Values

LESS_TOKEN

protected static final char LESS_TOKEN
See Also:
Constant Field Values

GREATER_TOKEN

protected static final char GREATER_TOKEN
See Also:
Constant Field Values

EXTEND_TOKEN

protected static final char EXTEND_TOKEN
See Also:
Constant Field Values

WILDCARD_TOKEN

protected static final char WILDCARD_TOKEN
See Also:
Constant Field Values
Constructor Detail

SearchFilter

public SearchFilter(String filter)
             throws InvalidSearchFilterException
Throws:
InvalidSearchFilterException
Method Detail

check

public boolean check(Attributes targetAttrs)
              throws NamingException
Description copied from interface: AttrFilter
Determines whether an attribute passes the filter.

Specified by:
check in interface AttrFilter
Throws:
NamingException

normalizeFilter

protected void normalizeFilter()

createNextFilter

protected com.sun.jndi.toolkit.dir.SearchFilter.StringFilter createNextFilter()
                                                                       throws InvalidSearchFilterException
Throws:
InvalidSearchFilterException

getCurrentChar

protected char getCurrentChar()

relCharAt

protected char relCharAt(int i)

consumeChar

protected void consumeChar()

consumeChars

protected void consumeChars(int i)

relIndexOf

protected int relIndexOf(int ch)

relSubstring

protected String relSubstring(int beginIndex,
                              int endIndex)

format

public static String format(Attributes attrs)
                     throws NamingException
Creates an LDAP filter as a conjuction of the attributes supplied.

Throws:
NamingException

findUnescaped

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 (\)


format

public static String format(String expr,
                            Object[] args)
                     throws NamingException
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.

Throws:
NamingException

selectAttributes

public static Attributes selectAttributes(Attributes originals,
                                          String[] attrIDs)
                                   throws NamingException
Throws:
NamingException

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.