com.isti.trinetwatch.ruleset
Class RuleSetParser

java.lang.Object
  extended bycom.isti.util.CfgFileParser
      extended bycom.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.
RuleSetParser(java.io.Reader rdr, LogFile logFileObj)
          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 uLevelTable, StatusLevelTable sLevelTable, RuleSetTable rSetTable, java.util.Hashtable helpStrTable)
          Parses the input stream as a rule-set file.
 
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.


RuleSetParser

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

Parameters:
rdr - stream reader object to read from.
logFileObj - log file object to use for debug messages. If null then no log file output is generated.
Method Detail

parseStream

public boolean parseStream(UsageLevelTable uLevelTable,
                           StatusLevelTable sLevelTable,
                           RuleSetTable rSetTable,
                           java.util.Hashtable helpStrTable)
Parses the input stream as a rule-set file.

Parameters:
uLevelTable - UsageLevelTable object to be filled in.
sLevelTable - StatusLevelTable object to be filled in.
rSetTable - RuleSetTable object to be filled in.
helpStrTable - 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()').

getErrorMessage

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

Overrides:
getErrorMessage in class CfgFileParser
Returns:
error message