Package gnu.mapping
Class WrongType
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- gnu.mapping.WrappedException
-
- gnu.mapping.WrongType
-
- All Implemented Interfaces:
Serializable
public class WrongType extends WrappedException
Exception thrown when a procedure parameter has the wrong type.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intARG_CASTnumber==ARG_CASTmeans a general cast.static intARG_DESCRIPTIONnumber==ARG_DESCRIPTIONmeans not a call,procnamedescribes the target.static intARG_UNKNOWNnumber==ARG_UNKNOWNmeans unknown argument number.static intARG_VARNAMEnumber==ARG_VARNAMEmeans not a call,procnameis a variable name.ObjectargValueThe actual argument that was bad.ObjectexpectedTypeThe expected parameter type (a Type or TypeValue), or a string name/description.intnumberNumber of the argument, 1-origin.ProcedureprocTheProcedurethat threw the exception (if non-null).StringprocnameName ofProcedurethat threw the exception (if non-null).static ObjectUNKNOWN
-
Constructor Summary
Constructors Constructor Description WrongType(int n, Object argValue, Type expectedType)WrongType(Procedure proc, int n, ClassCastException ex)WrongType(Procedure proc, int n, Object argValue)WrongType(Procedure proc, int n, Object argValue, Type expectedType)WrongType(Procedure proc, int n, Object argValue, String expectedType)WrongType(ClassCastException ex, Procedure proc, int n, Object argValue)WrongType(ClassCastException ex, String procname, int n, Object argValue)WrongType(String procname, int n, ClassCastException ex)WrongType(String procName, int n, Object argValue, String expectedType)WrongType(String name, int n, String u)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetMessage()static WrongTypemake(ClassCastException ex, Procedure proc, int n)Deprecated.static WrongTypemake(ClassCastException ex, Procedure proc, int n, Object argValue)This interface is designed for a compact call sequence.static WrongTypemake(ClassCastException ex, String procname, int n)Deprecated.static WrongTypemake(ClassCastException ex, String procname, int n, Object argValue)This interface is designed for a compact call sequence.-
Methods inherited from class gnu.mapping.WrappedException
getException, rethrow, toString, wrapIfNeeded
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Field Detail
-
number
public final int number
Number of the argument, 1-origin.
Can be an integer>= 1, or one of the valuesARG_UNKNOWN,ARG_VARNAME, orARG_DESCRIPTION.
-
ARG_UNKNOWN
public static final int ARG_UNKNOWN
number==ARG_UNKNOWNmeans unknown argument number.- See Also:
- Constant Field Values
-
ARG_VARNAME
public static final int ARG_VARNAME
number==ARG_VARNAMEmeans not a call,procnameis a variable name.- See Also:
- Constant Field Values
-
ARG_DESCRIPTION
public static final int ARG_DESCRIPTION
number==ARG_DESCRIPTIONmeans not a call,procnamedescribes the target. (deprecated/unused)- See Also:
- Constant Field Values
-
ARG_CAST
public static final int ARG_CAST
number==ARG_CASTmeans a general cast.- See Also:
- Constant Field Values
-
procname
public String procname
Name ofProcedurethat threw the exception (if non-null).
-
proc
public Procedure proc
TheProcedurethat threw the exception (if non-null).
-
argValue
public final Object argValue
The actual argument that was bad.
-
UNKNOWN
public static final Object UNKNOWN
-
expectedType
public Object expectedType
The expected parameter type (a Type or TypeValue), or a string name/description.
-
-
Constructor Detail
-
WrongType
public WrongType(Procedure proc, int n, ClassCastException ex)
-
WrongType
public WrongType(ClassCastException ex, Procedure proc, int n, Object argValue)
-
WrongType
public WrongType(String procname, int n, ClassCastException ex)
-
WrongType
public WrongType(ClassCastException ex, String procname, int n, Object argValue)
-
-
Method Detail
-
make
@Deprecated public static WrongType make(ClassCastException ex, Procedure proc, int n)
Deprecated.
-
make
@Deprecated public static WrongType make(ClassCastException ex, String procname, int n)
Deprecated.
-
make
public static WrongType make(ClassCastException ex, Procedure proc, int n, Object argValue)
This interface is designed for a compact call sequence.
-
make
public static WrongType make(ClassCastException ex, String procname, int n, Object argValue)
This interface is designed for a compact call sequence.
-
getMessage
public String getMessage()
- Overrides:
getMessagein classThrowable
-
-