Package org.opengis.parameter
Class InvalidParameterTypeException
- Object
-
- Throwable
-
- Exception
-
- RuntimeException
-
- IllegalStateException
-
- InvalidParameterTypeException
-
- All Implemented Interfaces:
Serializable
public class InvalidParameterTypeException extends IllegalStateException
Thrown byParameterValue
getter methods when a value can not be casted to the requested type. For example this exception is thrown whenParameterValue.doubleValue()
is invoked but the value is not convertible to adouble
.Note: This exception is of kindThis exception is typically thrown by the following methods:IllegalStateException
instead thanIllegalArgumentException
because it is not caused by a bad argument. It is rather a consequence of a zero-argument method invoked in a context where it is not allowed.- Since:
- 1.0
- See Also:
InvalidParameterValueException
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InvalidParameterTypeException(String message, String parameterName)
Creates an exception with the specified message and parameter name.InvalidParameterTypeException(String message, Throwable cause, String parameterName)
Creates an exception with the specified message, cause and parameter name.
-
Method Summary
Modifier and Type Method Description String
getParameterName()
Returns the parameter name.-
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
InvalidParameterTypeException
public InvalidParameterTypeException(String message, String parameterName)
Creates an exception with the specified message and parameter name.- Parameters:
message
- the detail message, saved for later retrieval by theThrowable.getMessage()
method.parameterName
- the parameter name.
-
InvalidParameterTypeException
public InvalidParameterTypeException(String message, Throwable cause, String parameterName)
Creates an exception with the specified message, cause and parameter name.- Parameters:
message
- the detail message, saved for later retrieval by theThrowable.getMessage()
method.cause
- the cause, saved for later retrieval by theThrowable.getCause()
method.parameterName
- the parameter name.- Since:
- 3.1
-
-
Method Detail
-
getParameterName
public String getParameterName()
Returns the parameter name.- Returns:
- the parameter name.
-
-