|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.config.CRLineAnalyzer
Reads in and analyzes a single line from the source text for a ConfigReader. See ConfigReader.
Source code: CRLineAnalyzer.java. Exmaple code: See the example code for ConfigReaderFA.
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
CRLineAnalyzer(StringBuffer sb_line,
int i_lineNumber,
int i_mlcStartLine,
int i_varStartLine,
StringOrBuffer sob_varStartName,
char c_varStartDelim,
Outputter optr_dbg,
CRLAObjects crla_objects)
Create a CRLineAnalyzer. |
Method Summary | |
char |
getDelimiter()
Get the delimiter of the variable that was started on this line. |
int |
getMLCStartLine()
At what line did the current multi-line comment start? |
String |
getName()
Get the name of the variable that was started on this line. |
String |
getValue()
Get the value of the variable existing on this line. |
int |
getVarStartLine()
At which line did the current variable start? |
boolean |
hasName()
Is this the first line in a variable? |
boolean |
hasValue()
Does this line contain a line within a value?. |
boolean |
isStartLine()
Is this line the beginning of a variable or comment? |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CRLineAnalyzer(StringBuffer sb_line, int i_lineNumber, int i_mlcStartLine, int i_varStartLine, StringOrBuffer sob_varStartName, char c_varStartDelim, Outputter optr_dbg, CRLAObjects crla_objects) throws ConfigFormatException
Create a CRLineAnalyzer.
sb_line
- The current line, including the ending line separator. May not be null and may not contain the line separator at any point except the end. If this does not contain a line separator, this is assumed to be the very last line in the source text.i_lineNumber
- The line number that sb_line is in the source text. May not be less than one. For use in potential error messages.i_mlcStartLine
- The line number on which the current multi-line comment was started. If equal to -1, this line is not in the middle of a multi-line comment. Otherwise this is the line number in which the multi-line comment (in which sb_line is contained) began. Therefore, it may not be equal to or greater than i_lineNumber.i_varStartLine
- The line number on which the current variable's value (of which sb_line is the second or subsequent line) was started. If equal to -1, this line is not part of a value. Otherwise this is the line number in which a variable began. Therefore, it may not be equal to or greater than i_lineNumber.ssb_varStartedName
- The name of the variable started before this line. If i_varStartLine does not equal -1, this must be non-null. If i_varStartLine equals -1, this must be null. This is for potential error messages only, and is unrelated to what is returned by getName.c_varStartDelim
- The delimiter of the variable started before this line. If ssb_varStartedName equals null, this is ignored. This is for potential error messages only, and is unrelated to what is returned by getDelimiter.crla_objects
- Holds the internal objects used by this CRLineAnalyzer, including the CRConfig. May not be null.optr_dbg
- The Outputter to use for debugging. May not be null.ConfigFormatException
- If any of the formatting rules for the source text of a ConfigReader are violated.Method Detail |
public final int getMLCStartLine()
At what line did the current multi-line comment start?
public final int getVarStartLine()
At which line did the current variable start?
public final boolean isStartLine()
Is this line the beginning of a variable or comment?
(getMLCStartLine() == i_lineNumber ||
getVarStartLine() == i_lineNumber ||
[is this line a single line comment?])
public final boolean hasName()
Is this the first line in a variable?
If it is, then the variable's name, delimiter and (first line of the) value can be retrieved with getName, getDelimiter and getValue.
public final boolean hasValue()
Does this line contain a line within a value?. If yes, get it with getValue.
public final String getName()
Get the name of the variable that was started on this line.
AssertException
- If hasName equals false.public final char getDelimiter()
Get the delimiter of the variable that was started on this line.
AssertException
- If hasName equals false.public final String getValue()
Get the value of the variable existing on this line.
AssertException
- If hasValue equals false.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava