org.opengis.parameter
Class InvalidParameterTypeException

Show UML class diagram
Object
  extended by Throwable
      extended by Exception
          extended by RuntimeException
              extended by IllegalStateException
                  extended by InvalidParameterTypeException
All Implemented Interfaces:
Serializable

public class InvalidParameterTypeException
extends IllegalStateException

Thrown by ParameterValue getter methods when a value can not be casted to the requested type. For example this exception is thrown when ParameterValue.doubleValue() is invoked but the value is not convertible to a double.

Note: This exception is of kind IllegalStateException instead than IllegalArgumentException because it is not caused by a bad argument. It is rather a consequence of a zero-argument method invoked in a context where is it not allowed.

Since:
1.0
See Also:
ParameterValue.intValue(), ParameterValue.doubleValue(), ParameterValue.booleanValue(), ParameterValue.stringValue(), ParameterValue.valueFile(), Serialized Form
Departure from OGC/ISO specification:
This exception is not part of the OGC specification.

Constructor Summary
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
 String getParameterName()
          Returns the parameter name.
 
Methods inherited from class Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidParameterTypeException

public InvalidParameterTypeException(String message,
                                     String parameterName)
Creates an exception with the specified message and parameter name.

Parameters:
message - The detail message, or null if none. The detail message is saved for later retrieval by the Throwable.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, or null if none. The detail message is saved for later retrieval by the Throwable.getMessage() method.
cause - The cause, or null if none. The cause is saved for later retrieval by the Throwable.getCause() method.
parameterName - The parameter name.
Since:
3.1
Method Detail

getParameterName

public String getParameterName()
Returns the parameter name.

Returns:
The parameter name.


Copyright © 1994-2012 Open Geospatial Consortium. All Rights Reserved.