Converter (jackson-databind 2.6.0 API) (original) (raw)
- Type Parameters:
IN
- Type of values converter takesOUT
- Result type from conversion
All Known Implementing Classes:
Converter.None, StdConverter
public interface Converter<IN,OUT>
Helper interface for things that convert Objects of one type to another.
NOTE: implementors are strongly encouraged to extend StdConverter instead of directly implementing Converter, since that can help with default implementation of typically boiler-plate code.
Since:
2.1
See Also:
StdDelegatingSerializer
Nested Class Summary
Nested Classes
Modifier and Type Interface and Description static class Converter.None This marker class is only to be used with annotations, to indicate that no converter is to be used. Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type Method and Description OUT convert(IN value) Main conversion method. JavaType getInputType(TypeFactory typeFactory) Method that can be used to find out actual input (source) type; this usually can be determined from type parameters, but may need to be implemented differently from programmatically defined converters (which can not change static type parameter bindings). JavaType getOutputType(TypeFactory typeFactory) Method that can be used to find out actual output (target) type; this usually can be determined from type parameters, but may need to be implemented differently from programmatically defined converters (which can not change static type parameter bindings). Method Detail
* #### convert [OUT](../../../../../com/fasterxml/jackson/databind/util/Converter.html "type parameter in Converter") convert([IN](../../../../../com/fasterxml/jackson/databind/util/Converter.html "type parameter in Converter") value) Main conversion method. * #### getInputType [JavaType](../../../../../com/fasterxml/jackson/databind/JavaType.html "class in com.fasterxml.jackson.databind") getInputType([TypeFactory](../../../../../com/fasterxml/jackson/databind/type/TypeFactory.html "class in com.fasterxml.jackson.databind.type") typeFactory) Method that can be used to find out actual input (source) type; this usually can be determined from type parameters, but may need to be implemented differently from programmatically defined converters (which can not change static type parameter bindings). Since: 2.2 * #### getOutputType [JavaType](../../../../../com/fasterxml/jackson/databind/JavaType.html "class in com.fasterxml.jackson.databind") getOutputType([TypeFactory](../../../../../com/fasterxml/jackson/databind/type/TypeFactory.html "class in com.fasterxml.jackson.databind.type") typeFactory) Method that can be used to find out actual output (target) type; this usually can be determined from type parameters, but may need to be implemented differently from programmatically defined converters (which can not change static type parameter bindings). Since: 2.2