org.pfsw.text
Class BaseMatchRuleParser

java.lang.Object
  extended by org.pfsw.text.BaseMatchRuleParser
Direct Known Subclasses:
DefaultMatchRuleParser, LdapFilterParser

public abstract class BaseMatchRuleParser
extends java.lang.Object

Abstract superclass for parsers that produce a MatchRule from any specific syntax. This class provides some common methods and a instance variables that holds a scanner (StringScanner) which most parsers need.


Constructor Summary
BaseMatchRuleParser()
          Initialize the new instance with default values
BaseMatchRuleParser(java.lang.String rule)
          Initialize the new instance with the given rule.
 
Method Summary
protected  boolean atEnd(char ch)
          Returns true, if the given character indicates the end of a scanned string.
protected  void checkExpectedEnd(char ch)
           
protected  void checkUnexpectedEnd(char ch)
           
protected  StringScanner scanner()
           
protected  void scanner(StringScanner newValue)
           
protected  StringUtil str()
           
protected  void throwException(java.lang.String msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseMatchRuleParser

public BaseMatchRuleParser()
Initialize the new instance with default values


BaseMatchRuleParser

public BaseMatchRuleParser(java.lang.String rule)
Initialize the new instance with the given rule.

Parameters:
rule - Any rule string the internal scanner should be initialized with
Method Detail

atEnd

protected boolean atEnd(char ch)
Returns true, if the given character indicates the end of a scanned string.


checkUnexpectedEnd

protected void checkUnexpectedEnd(char ch)
                           throws MatchRuleParseException
Throws:
MatchRuleParseException

checkExpectedEnd

protected void checkExpectedEnd(char ch)
                         throws MatchRuleParseException
Throws:
MatchRuleParseException

throwException

protected void throwException(java.lang.String msg)
                       throws MatchRuleParseException
Throws:
MatchRuleParseException

scanner

protected StringScanner scanner()

scanner

protected void scanner(StringScanner newValue)

str

protected StringUtil str()