java.util

Class IllegalFormatConversionException

public class IllegalFormatConversionException extends IllegalFormatException

Thrown when the type of an argument supplied to the {@link Formatter#format()} method of a {@link Formatter} does not match the conversion character specified for it.

Since: 1.5

Constructor Summary
IllegalFormatConversionException(char c, Class<?> arg)
Constructs a new IllegalFormatConversionException which specifies that the argument of type arg does not match the conversion character, c.
Method Summary
Class<?>getArgumentClass()
Returns the type of the mismatched argument.
chargetConversion()
Returns the conversion character.

Constructor Detail

IllegalFormatConversionException

public IllegalFormatConversionException(char c, Class<?> arg)
Constructs a new IllegalFormatConversionException which specifies that the argument of type arg does not match the conversion character, c.

Parameters: c the conversion character. arg the type which doesn't match the conversion character.

Throws: NullPointerException if arg is null.

Method Detail

getArgumentClass

public Class<?> getArgumentClass()
Returns the type of the mismatched argument.

Returns: the type of the mismatched argument.

getConversion

public char getConversion()
Returns the conversion character.

Returns: the conversion character.