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.
- If the string is null, sets an error code of IS_NULL.
- 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.
- if the string is shorter than the minimum length, sets TOO_SHORT.
- if it is longer than the maximum length, sets TOO_LONG.
- 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.
- if the string is numeric, and the number is smaller than the lower bound which you specified, then sets TOO_SMALL.
- however, if a numeric string is larger than the upper bound, then sets TOO_LARGE.
- 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
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 |
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
ParseStringException
public ParseStringException(int code)
errorCode
public int errorCode()