@API(value=Experimental) public abstract class SimpleArgumentConverter extends Object implements ArgumentConverter
SimpleArgumentConverter
is an abstract base class for ArgumentConverter
implementations.ArgumentConverter
Constructor and Description |
---|
SimpleArgumentConverter() |
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
convert(Object source,
Class<?> targetType)
Convert the supplied
source object into to the supplied
targetType . |
Object |
convert(Object source,
ParameterContext context)
Convert the supplied
source object according to the supplied
context . |
public final Object convert(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 Object convert(Object source, 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.