org.pfsw.text
Class LdapFilterParser

java.lang.Object
  extended by org.pfsw.text.BaseMatchRuleParser
      extended by org.pfsw.text.LdapFilterParser

public class LdapFilterParser
extends BaseMatchRuleParser

An instance of this class can be used to parse an LDAP filter string to a MatchRule.


Constructor Summary
LdapFilterParser()
          Initialize the new instance with default values.
 
Method Summary
protected  char checkNextClosingParenthesis()
           
protected  char checkNextOpeningParenthesis()
           
protected  MatchRule createMatchRuleOn(MatchGroup group)
           
protected  boolean isLiteral(char ch)
           
protected  boolean isNotOperator(char ch)
           
protected  boolean isOperator(char ch)
           
protected  boolean isValidAttributeNameCharacter(char ch)
           
protected  void parenthesisExpected(java.lang.String prefix)
           
protected  MatchGroup parse()
           
 MatchRule parse(java.lang.String filter)
          Parse the given LDAP filter string to a MatchRule object that can be used to check attributes in a Map, if they match the rule (filter).
protected  MatchAttribute parseAttribute()
           
protected  MatchElement parseElement()
           
static MatchRule parseFilter(java.lang.String filter)
          Parse the given LDAP filter string to a MatchRule object that can be used to check attributes in a Map, if they match the rule (filter).
protected  MatchGroup parseGroup(char operator)
           
protected  MatchElement parseNotElement()
           
protected  MatchGroup parseToGroup(java.lang.String filter)
          Parse the given LDAP filter string to a MatchGroup which can be used to create a MatchRule.
 
Methods inherited from class org.pfsw.text.BaseMatchRuleParser
atEnd, checkExpectedEnd, checkUnexpectedEnd, scanner, scanner, str, throwException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapFilterParser

public LdapFilterParser()
Initialize the new instance with default values.

Method Detail

parseFilter

public static MatchRule parseFilter(java.lang.String filter)
                             throws MatchRuleParseException
Parse the given LDAP filter string to a MatchRule object that can be used to check attributes in a Map, if they match the rule (filter).

Parameters:
filter - The LDAP search filter
Throws:
MatchRuleParseException - Each syntax error in the given filter causes this exception with a short description of what is wrong

parse

public MatchRule parse(java.lang.String filter)
                throws MatchRuleParseException
Parse the given LDAP filter string to a MatchRule object that can be used to check attributes in a Map, if they match the rule (filter).

Parameters:
filter - The LDAP search filter
Throws:
MatchRuleParseException - Each syntax error in the given filter causes this exception with a short description of what is wrong

parseToGroup

protected MatchGroup parseToGroup(java.lang.String filter)
                           throws MatchRuleParseException
Parse the given LDAP filter string to a MatchGroup which can be used to create a MatchRule.

Parameters:
filter - The LDAP search filter
Throws:
MatchRuleParseException - Each syntax error in the given filter causes this exception with a short description of what is wrong

parse

protected MatchGroup parse()
                    throws MatchRuleParseException
Throws:
MatchRuleParseException

parseElement

protected MatchElement parseElement()
                             throws MatchRuleParseException
Throws:
MatchRuleParseException

parseNotElement

protected MatchElement parseNotElement()
                                throws MatchRuleParseException
Throws:
MatchRuleParseException

parseGroup

protected MatchGroup parseGroup(char operator)
                         throws MatchRuleParseException
Throws:
MatchRuleParseException

parseAttribute

protected MatchAttribute parseAttribute()
                                 throws MatchRuleParseException
Throws:
MatchRuleParseException

isNotOperator

protected boolean isNotOperator(char ch)

isOperator

protected boolean isOperator(char ch)

isLiteral

protected boolean isLiteral(char ch)

isValidAttributeNameCharacter

protected boolean isValidAttributeNameCharacter(char ch)

parenthesisExpected

protected void parenthesisExpected(java.lang.String prefix)
                            throws MatchRuleParseException
Throws:
MatchRuleParseException

checkNextOpeningParenthesis

protected char checkNextOpeningParenthesis()
                                    throws MatchRuleParseException
Throws:
MatchRuleParseException

checkNextClosingParenthesis

protected char checkNextClosingParenthesis()
                                    throws MatchRuleParseException
Throws:
MatchRuleParseException

createMatchRuleOn

protected MatchRule createMatchRuleOn(MatchGroup group)