org.locomotive.util
Class ParseStringException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.locomotive.util.ParseStringException

public class ParseStringException
extends java.lang.Exception

This Exception class is used primarily by the StringUtil class for signaling when a string value does not fit a particular format. Here is an explanation of each of the error codes.

  1. If the string is null, sets an error code of IS_NULL.
  2. if the string is not null, but it's an empty string "", and the minimum length argument is not 0, then the FormData generates IS_EMPTY.
  3. if the string is shorter than the minimum length, sets TOO_SHORT.
  4. if it is longer than the maximum length, sets TOO_LONG.
  5. if the string does not fit the specific type you specified -- for example, if you expected digits, and there were alphabetical letters in the string -- then sets DOESNT_FIT_TYPE.
  6. if the string is numeric, and the number is smaller than the lower bound which you specified, then sets TOO_SMALL.
  7. however, if a numeric string is larger than the upper bound, then sets TOO_LARGE.
  8. if there was no error at all, sets NO_ERROR.
You simply call errorCode() to get the error code for this ParseStringException.

See Also:
Serialized Form

Field Summary
static int DOESNT_FIT_TYPE
           
static int IS_EMPTY
           
static int IS_NULL
           
static int NO_ERROR
           
static int TOO_LARGE
           
static int TOO_LONG
           
static int TOO_SHORT
           
static int TOO_SMALL
           
 
Constructor Summary
ParseStringException(int code)
           
 
Method Summary
 int errorCode()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ERROR

public static final int NO_ERROR

IS_NULL

public static final int IS_NULL

IS_EMPTY

public static final int IS_EMPTY

TOO_SHORT

public static final int TOO_SHORT

TOO_LONG

public static final int TOO_LONG

TOO_SMALL

public static final int TOO_SMALL

TOO_LARGE

public static final int TOO_LARGE

DOESNT_FIT_TYPE

public static final int DOESNT_FIT_TYPE
Constructor Detail

ParseStringException

public ParseStringException(int code)
Method Detail

errorCode

public int errorCode()