Package com.nt.udc.io

Class CConfigScanner

java.lang.Object
com.nt.udc.io.CConfigScanner

public class CConfigScanner extends Object
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 Details

    • EOF

      public final int EOF
      This constant member represents the end-of-file.
      See Also:
    • CONTEXT

      public final int CONTEXT
      This constant member represents the ['context'] tokens.
      See Also:
    • STRING

      public final int STRING
      This constant member represents regular strings.
      See Also:
    • DELIMITER

      public final int DELIMITER
      This constant member represent the delimiter.
      See Also:
    • m_debugLevel

      protected static int m_debugLevel
  • Constructor Details

    • CConfigScanner

      public CConfigScanner(String filename, ILogger iLogger) throws Exception
      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

      public String getTokenValue()
    • setDebugLevel

      public static void setDebugLevel(int debugLevel)
    • nextToken

      public int nextToken() throws Exception
      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

      protected void error(String fName, String msg)
    • debug

      protected void debug(String fName, String msg)