JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util
Class JCFormatParserUtil

java.lang.Object
  |
  +--com.klg.jclass.util.JCFormatParserUtil

public class JCFormatParserUtil
extends Object

This is a utility class made up of static methods useful for parsing data for component data sources. It is not intended for general public consumption, but it must be a public class in order to be accessible by other JClass packages.


Field Summary
static char QUOTE
          What JClass data soruces recognize as a quote character.
 
Constructor Summary
JCFormatParserUtil()
           
 
Method Summary
static void displayErrorMessage(StreamTokenizer tokenizer, String strError)
          Displays a tokenizer-related error message.
static Object getNextToken(StreamTokenizer tokenizer)
          Returns the next token from a stream tokenizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUOTE

public static final char QUOTE
What JClass data soruces recognize as a quote character.

See Also:
Constant Field Values
Constructor Detail

JCFormatParserUtil

public JCFormatParserUtil()
Method Detail

getNextToken

public static Object getNextToken(StreamTokenizer tokenizer)
                           throws IOException
Returns the next token from a stream tokenizer. This special call tries to convert numbers of the format "2.13e-12" into real numbers. Without this method, the stream tokenizer will split them into two tokens: "2.13" and "e-12".

Parameters:
tokenizer - active StreamTokenizer from which to extract and parse the next token
Returns:
Throws:
IOException

displayErrorMessage

public static void displayErrorMessage(StreamTokenizer tokenizer,
                                       String strError)
Displays a tokenizer-related error message. This isn't intended for public consumption, although you could use it for displaying your own tokenizer-related error messages

Uses the provided tokenizer to display line numbers and token in an error message using the following format:

 Error reading data: line NNN: <strError>:<token>
 
Where strError is the String passed in as a parameter and token is the current token in the tokenizer.

Parameters:
tokenizer - active StreamTokenizer, preferably the one that has encountered some kind of error
strError - String to embed into the error message, as shown above

Copyright © 2004 Quest Software Inc..
All rights reserved.