Package com.nt.udc.io
Class CConfigScanner
java.lang.Object
com.nt.udc.io.CConfigScanner
This class is used to build tokens in a configuration file that
conforms to the syntax:
file:: { ['['context']'] {string}* } *
Example:
[record:ingress]
100 1 md1
101 0 rv
[record:egress]
200 1 md1
201 0 rv
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
This constant member represents the ['context'] tokens.final int
This constant member represent the delimiter.final int
This constant member represents the end-of-file.protected static int
final int
This constant member represents regular strings. -
Constructor Summary
ConstructorsConstructorDescriptionCConfigScanner
(String filename, ILogger iLogger) This constructor initializes the input stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
This function is called to close the scanner's input stream.protected void
protected void
static int
int
This function retrieves the next token and updates m_tokenValue.boolean
pushBack()
static void
setDebugLevel
(int debugLevel)
-
Field Details
-
EOF
public final int EOFThis constant member represents the end-of-file.- See Also:
-
CONTEXT
public final int CONTEXTThis constant member represents the ['context'] tokens.- See Also:
-
STRING
public final int STRINGThis constant member represents regular strings.- See Also:
-
DELIMITER
public final int DELIMITERThis constant member represent the delimiter.- See Also:
-
m_debugLevel
protected static int m_debugLevel
-
-
Constructor Details
-
CConfigScanner
This constructor initializes the input stream. It opens the specified file, creates the stream tokenizer and initializes it.- Throws:
Exception
-
-
Method Details
-
getDebugLevel
public static int getDebugLevel() -
getTokenValue
-
setDebugLevel
public static void setDebugLevel(int debugLevel) -
nextToken
This function retrieves the next token and updates m_tokenValue.- Returns:
- A constant representing the next token. m_tokenValue is updated according to the next token's value. If m_pushBack was set to true (meaning that the token read last was to be pushed back) then the same token is returned the next time nextToken is called.
- Throws:
Exception
-
pushBack
public boolean pushBack() -
close
public void close()This function is called to close the scanner's input stream. -
error
-
debug
-