Package org.apache.wicket.util.convert
Class ConversionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.wicket.util.convert.ConversionException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
StringValueConversionException
public class ConversionException extends java.lang.RuntimeExceptionThrown for conversion exceptions.- Author:
- Eelco Hillenius
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConversionException(java.lang.String message)Construct exception with message.ConversionException(java.lang.String message, java.lang.Throwable cause)Construct exception with message and cause.ConversionException(java.lang.Throwable cause)Construct exception with cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IConverter<?>getConverter()Gets the used converter.java.text.FormatgetFormat()Get the used format.java.util.LocalegetLocale()Get the used locale.java.lang.StringgetResourceKey()java.lang.ObjectgetSourceValue()Gets the tried value.java.lang.Class<?>getTargetType()Gets the target property type.java.util.Map<java.lang.String,java.lang.Object>getVariables()Returns the map of variables for this exception.ConversionExceptionsetConverter(IConverter<?> converter)Sets the used converter.ConversionExceptionsetFormat(java.text.Format format)Sets the used format.ConversionExceptionsetLocale(java.util.Locale locale)Sets the used locale.ConversionExceptionsetResourceKey(java.lang.String resourceKey)Set the resource key for the message that should be displayed.ConversionExceptionsetSourceValue(java.lang.Object sourceValue)Sets the tried value.ConversionExceptionsetTargetType(java.lang.Class<?> targetType)Sets the target property type.ConversionExceptionsetVariable(java.lang.String name, java.lang.Object value)Sets a variable that will be used in substitution
-
-
-
Constructor Detail
-
ConversionException
public ConversionException(java.lang.String message)
Construct exception with message.- Parameters:
message- message
-
ConversionException
public ConversionException(java.lang.String message, java.lang.Throwable cause)Construct exception with message and cause.- Parameters:
message- messagecause- cause
-
ConversionException
public ConversionException(java.lang.Throwable cause)
Construct exception with cause.- Parameters:
cause- cause
-
-
Method Detail
-
getConverter
public final IConverter<?> getConverter()
Gets the used converter.- Returns:
- the used converter.
-
getFormat
public final java.text.Format getFormat()
Get the used format.- Returns:
- the used format
-
getLocale
public final java.util.Locale getLocale()
Get the used locale.- Returns:
- the used locale
-
getSourceValue
public final java.lang.Object getSourceValue()
Gets the tried value.- Returns:
- the tried value.
-
getTargetType
public final java.lang.Class<?> getTargetType()
Gets the target property type.- Returns:
- the target property type.
-
setConverter
public final ConversionException setConverter(IConverter<?> converter)
Sets the used converter.- Parameters:
converter- the converter.- Returns:
- This
-
setFormat
public final ConversionException setFormat(java.text.Format format)
Sets the used format.- Parameters:
format- the used format.- Returns:
- This
-
setLocale
public final ConversionException setLocale(java.util.Locale locale)
Sets the used locale.- Parameters:
locale- the used locale.- Returns:
- This
-
setSourceValue
public final ConversionException setSourceValue(java.lang.Object sourceValue)
Sets the tried value.- Parameters:
sourceValue- the tried value.- Returns:
- This
-
setTargetType
public final ConversionException setTargetType(java.lang.Class<?> targetType)
Sets the target property type.- Parameters:
targetType- sets the target property type- Returns:
- This
-
getResourceKey
public java.lang.String getResourceKey()
- Returns:
- The resource key for the message that should be displayed
-
setResourceKey
public ConversionException setResourceKey(java.lang.String resourceKey)
Set the resource key for the message that should be displayed.- Parameters:
resourceKey- sets the resource key- Returns:
- This
-
setVariable
public ConversionException setVariable(java.lang.String name, java.lang.Object value)
Sets a variable that will be used in substitution- Parameters:
name- variable namevalue- variable value- Returns:
- this for chaining
-
getVariables
public java.util.Map<java.lang.String,java.lang.Object> getVariables()
Returns the map of variables for this exception.- Returns:
- map of variables for this exception (or null if no variables were defined)
-
-