ArgumentConverter
DefaultArgumentConverter
@API(status=EXPERIMENTAL, since="5.0") public abstract class SimpleArgumentConverter extends java.lang.Object implements ArgumentConverter
SimpleArgumentConverter
is an abstract base class for ArgumentConverter
implementations.ArgumentConverter
Constructor | Description |
---|---|
SimpleArgumentConverter() |
Modifier and Type | Method | Description |
---|---|---|
protected abstract java.lang.Object |
convert(java.lang.Object source,
java.lang.Class<?> targetType) |
Convert the supplied
source object into to the supplied
targetType . |
java.lang.Object |
convert(java.lang.Object source,
ParameterContext context) |
Convert the supplied
source object according to the supplied
context . |
public final java.lang.Object convert(java.lang.Object source, ParameterContext context) throws ArgumentConversionException
ArgumentConverter
source
object according to the supplied
context
.convert
in interface ArgumentConverter
source
- the source object to convert; may be null
context
- the parameter context where the converted object will be
used; never null
null
but only if the target
type is a reference typeArgumentConversionException
- if an error occurs during the
conversionprotected abstract java.lang.Object convert(java.lang.Object source, java.lang.Class<?> targetType) throws ArgumentConversionException
source
object into to the supplied
targetType
.source
- the source object to convert; may be null
targetType
- the target type the source object should be converted
into; never null
null
but only if the target
type is a reference type.ArgumentConversionException
- in case an error occurs during the
conversion.