Class ConversionException

    • Constructor Detail

      • ConversionException

        public ConversionException​(String message)
        Construct exception with message.
        Parameters:
        message - message
      • ConversionException

        public ConversionException​(String message,
                                   Throwable cause)
        Construct exception with message and cause.
        Parameters:
        message - message
        cause - cause
      • ConversionException

        public ConversionException​(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 Format getFormat()
        Get the used format.
        Returns:
        the used format
      • getLocale

        public final Locale getLocale()
        Get the used locale.
        Returns:
        the used locale
      • getSourceValue

        public final Object getSourceValue()
        Gets the tried value.
        Returns:
        the tried value.
      • getTargetType

        public final 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​(Format format)
        Sets the used format.
        Parameters:
        format - the used format.
        Returns:
        This
      • setLocale

        public final ConversionException setLocale​(Locale locale)
        Sets the used locale.
        Parameters:
        locale - the used locale.
        Returns:
        This
      • setSourceValue

        public final ConversionException setSourceValue​(Object sourceValue)
        Sets the tried value.
        Parameters:
        sourceValue - the tried value.
        Returns:
        This
      • setTargetType

        public final ConversionException setTargetType​(Class<?> targetType)
        Sets the target property type.
        Parameters:
        targetType - sets the target property type
        Returns:
        This
      • getResourceKey

        public String getResourceKey()
        Returns:
        The resource key for the message that should be displayed
      • setResourceKey

        public ConversionException setResourceKey​(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​(String name,
                                               Object value)
        Sets a variable that will be used in substitution
        Parameters:
        name - variable name
        value - variable value
        Returns:
        this for chaining
      • getVariables

        public Map<String,​Object> getVariables()
        Returns the map of variables for this exception.
        Returns:
        map of variables for this exception (or null if no variables were defined)