Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.util
Class UnsupportedConversionException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              umontreal.iro.lecuyer.util.UnsupportedConversionException

All Implemented Interfaces:
  Serializable

    public class UnsupportedConversionException

extends Exception

Exception occurring when a conversion is not supported by a method of `StringConvert`. This exception is thrown when a conversion method is given a target class it does not support. This differs from the case where the target class is supported while the conversion fails.

See Also:
  Serialized Form

Constructor Summary
`UnsupportedConversionException()` Constructs a new unsupported conversion exception with no target class or message.
`UnsupportedConversionException(Class<?> cls, String val)` Constructs a new unsupported conversion exception with target class `cls`, converted value `val` and no message.
`UnsupportedConversionException(Class<?> cls, String val, String message)` Constructs a new unsupported conversion exception with target class `cls`, converted value `val` and message `message`.
`UnsupportedConversionException(String message)` Constructs a new unsupported conversion exception with no target class and message `message`.

Method Summary
`Class<?>` | `getTargetClass()` Returns the target class of the conversion causing the exception.
`String` | `getValue()` Returns the value to be converted and causing the exception.
`String` | `toString()` Returns a short description of the exception.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### UnsupportedConversionException

    public UnsupportedConversionException()

  Constructs a new unsupported conversion exception with no target class or message.

### UnsupportedConversionException

    public UnsupportedConversionException(String message)

  Constructs a new unsupported conversion exception with no target class and message `message`.

  Parameters:
    `message` - the message describing the exception.

### UnsupportedConversionException

    public UnsupportedConversionException(Class<?> cls,
                                          String val)

  Constructs a new unsupported conversion exception with target class `cls`, converted value `val` and no message.

  Parameters:
    `cls` - the target class.
    `val` - the value being converted.

### UnsupportedConversionException

    public UnsupportedConversionException(Class<?> cls,
                                          String val,
                                          String message)

  Constructs a new unsupported conversion exception with target class `cls`, converted value `val` and message `message`.

  Parameters:
    `cls` - the target class.
    `val` - the value being converted.
    `message` - the message describing the exception.

Method Detail

### getTargetClass

    public Class<?> getTargetClass()

  Returns the target class of the conversion causing the exception.

  Returns:
    the target class.

### getValue

    public String getValue()

  Returns the value to be converted and causing the exception.

  Returns:
    the value to be converted.

### toString

    public String toString()

  Returns a short description of the exception. If no target class and value is associated to the object, this calls the base class's `toString` method. Otherwise, a string containing the following elements is constructed and returned.
  - The name of the class of the object.
  - `": Cannot convert value "`
  - If `getValue()` returns a non-`null` value, the returned value followed by a space
  - `"to target class"`
  - If the target class is specified, a space followed by the target class name
  - If the message is specified, the message preceeded by `", "`.

  Overrides:
    `toString` in class `Throwable`
  Returns:
    the short string describing the exception.

Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

To submit a bug or ask questions, send an e-mail to Richard Simard.