@API(status=STABLE,
since="5.7")
public abstract class SimpleArgumentConverter
extends java.lang.Object
implements ArgumentConverter
SimpleArgumentConverter is an abstract base class for
ArgumentConverter implementations that only need to know the target
type and do not need access to the ParameterContext to perform the
conversion.ArgumentConverter,
TypedArgumentConverter| Constructor and Description |
|---|
SimpleArgumentConverter() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.lang.Object |
convert(java.lang.Object source,
java.lang.Class<?> targetType)
Convert the supplied
source object into 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
ArgumentConvertersource object according to the supplied
context.convert in interface ArgumentConvertersource - the source object to convert; may be nullcontext - the parameter context where the converted object will be
used; never nullnull 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 the supplied
targetType.source - the source object to convert; may be nulltargetType - the target type the source object should be converted
into; never nullnull but only if the target
type is a reference typeArgumentConversionException - in case an error occurs during the
conversion