|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.util.CfgFileParser
Class CfgFileParser contains support functions for reading from configuration files.
Field Summary | |
protected static char |
CLOSE_BRACKET_CHAR
|
protected boolean |
commaSepFlag
|
protected java.lang.String |
errorMessage
|
protected CfgFileTokenizer |
inTokens
|
protected static char |
OPEN_BRACKET_CHAR
|
protected boolean |
wordSlashFlag
|
Constructor Summary | |
CfgFileParser(java.io.Reader rdr)
Creates parser object which reads from the given stream. |
|
CfgFileParser(java.io.Reader rdr,
boolean wordSlashFlag)
Creates parser object which reads from the given stream. |
|
CfgFileParser(java.io.Reader rdr,
boolean wordSlashFlag,
boolean commaSepFlag)
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). |
protected java.lang.Number |
parseEqualsNumber()
Parses "equals" sign ('=') followed by a number. |
protected java.lang.String |
parseEqualsString()
Parses "equals" sign ('=') followed by a string. |
void |
resetInput(java.io.Reader rdr)
Resets the input stream for this parser. |
protected void |
setDupFieldMsg(java.lang.String fieldName)
Builds "Duplicate entry for field" error message with given string. |
protected void |
setIllegalCharMsg(int charVal)
Builds "Illegal character" error message with given character value. |
protected void |
setNoCloseBracketMsg()
Builds "Close bracket not found" error message. |
protected void |
setNoOpenBracketMsg()
Builds "Open bracket not found" error message. |
protected void |
setUnexpectedEOFMsg()
Builds "Unexpected end-of-file" error message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final char OPEN_BRACKET_CHAR
protected static final char CLOSE_BRACKET_CHAR
protected final boolean wordSlashFlag
protected final boolean commaSepFlag
protected CfgFileTokenizer inTokens
protected java.lang.String errorMessage
Constructor Detail |
public CfgFileParser(java.io.Reader rdr, boolean wordSlashFlag, boolean commaSepFlag)
rdr
- readerwordSlashFlag
- true to allow the forward-slash character to be
parsed as part of a word token (this disables '//' comments); false
to make the forward-slash character be a token separator.commaSepFlag
- true for comma to be a token separator; false
for comma to be parsed as part of a word token.public CfgFileParser(java.io.Reader rdr, boolean wordSlashFlag)
rdr
- readerwordSlashFlag
- true to allow the forward-slash character to be
parsed as part of a word token (this disables '//' comments); false
to make the forward-slash character be a token separator.public CfgFileParser(java.io.Reader rdr)
rdr
- readerMethod Detail |
public void resetInput(java.io.Reader rdr)
rdr
- reader input stream object to use.protected java.lang.String parseEqualsString() throws java.io.IOException
java.io.IOException
protected java.lang.Number parseEqualsNumber() throws java.io.IOException
java.io.IOException
protected void setIllegalCharMsg(int charVal)
charVal
- character valueprotected void setUnexpectedEOFMsg()
protected void setNoOpenBracketMsg()
protected void setNoCloseBracketMsg()
protected void setDupFieldMsg(java.lang.String fieldName)
fieldName
- field namepublic java.lang.String getErrorMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |