com.isti.trinetwatch.ruleset
Class RuleSetParser

java.lang.Object
  extended by com.isti.util.CfgFileParser
      extended by com.isti.trinetwatch.ruleset.RuleSetParser

public class RuleSetParser
extends CfgFileParser

Class RuleSetParser reads data from an input stream into rule-set objects.


Field Summary
(package private)  java.util.Hashtable statusNamesToObjs
           
(package private)  java.util.Hashtable usageNamesToObjs
           
 
Fields inherited from class com.isti.util.CfgFileParser
CLOSE_BRACKET_CHAR, commaSepFlag, errorMessage, inTokens, OPEN_BRACKET_CHAR, wordSlashFlag
 
Constructor Summary
RuleSetParser(java.io.Reader rdr)
          Creates parser object which reads from the given stream.
 
Method Summary
 java.lang.String getErrorMessage()
          Returns message string for last error (or 'No error' if none).
 boolean parseStream(UsageLevelTable destULevelTable, StatusLevelTable destSLevelTable, RuleSetTable destRSetTable, java.util.Hashtable destHelpStrTable)
          Parses the input stream as a rule-set file.
 boolean parseStream(UsageLevelTable destULevelTable, StatusLevelTable destSLevelTable, RuleSetTable destRSetTable, java.util.Hashtable destHelpStrTable, LogFile logFileObj)
          Parses the input stream as a rule-set file.
 void setUseCriteriaRegExFlag(boolean b)
          Set the use regular expressions for criteria flag.
 
Methods inherited from class com.isti.util.CfgFileParser
parseEqualsNumber, parseEqualsString, resetInput, setDupFieldMsg, setIllegalCharMsg, setNoCloseBracketMsg, setNoOpenBracketMsg, setUnexpectedEOFMsg
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

usageNamesToObjs

final java.util.Hashtable usageNamesToObjs

statusNamesToObjs

final java.util.Hashtable statusNamesToObjs
Constructor Detail

RuleSetParser

public RuleSetParser(java.io.Reader rdr)
Creates parser object which reads from the given stream.

Parameters:
rdr - stream reader object to read from.
Method Detail

parseStream

public boolean parseStream(UsageLevelTable destULevelTable,
                           StatusLevelTable destSLevelTable,
                           RuleSetTable destRSetTable,
                           java.util.Hashtable destHelpStrTable,
                           LogFile logFileObj)
Parses the input stream as a rule-set file.

Parameters:
destULevelTable - UsageLevelTable object to be filled in.
destSLevelTable - StatusLevelTable object to be filled in.
destRSetTable - RuleSetTable object to be filled in.
destHelpStrTable - hash table of help strings to be filled in.
logFileObj - log file object to use for debug messages. If null then no log file output is generated.
Returns:
true if successful, false if parameter or syntax error detected (retrieve error message with 'getErrorMessage()').

parseStream

public boolean parseStream(UsageLevelTable destULevelTable,
                           StatusLevelTable destSLevelTable,
                           RuleSetTable destRSetTable,
                           java.util.Hashtable destHelpStrTable)
Parses the input stream as a rule-set file.

Parameters:
destULevelTable - UsageLevelTable object to be filled in.
destSLevelTable - StatusLevelTable object to be filled in.
destRSetTable - RuleSetTable object to be filled in.
destHelpStrTable - hash table of help strings to be filled in.
Returns:
true if successful, false if parameter or syntax error detected (retrieve error message with 'getErrorMessage()').

setUseCriteriaRegExFlag

public void setUseCriteriaRegExFlag(boolean b)
Set the use regular expressions for criteria flag.

Parameters:
b - true if specified regular expressions should be used for criteria.

getErrorMessage

public java.lang.String getErrorMessage()
Returns message string for last error (or 'No error' if none).

Overrides:
getErrorMessage in class CfgFileParser
Returns:
Message string for last error (or 'No error' if none).