public interface ICoercionProvider
IJsonFormatTypeCoercer.
See IJsonFormatTypeCoercer
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
coerce(java.lang.Object value,
java.lang.reflect.Type type)
Coerce
value to type. |
java.lang.Object |
toBindingValue(java.lang.Object value)
Coerce
value parameter to a value suitable for a Bindings e.g., a JSON bindings. |
java.lang.Object coerce(java.lang.Object value,
java.lang.reflect.Type type)
value to type. Return ICallHandler.UNHANDLED if not coerced.
It is imperative that this method coerces only between the JSON types and Java types it explicitly
handles otherwise you may inadvertently perform a coercion that is incorrect that is better handled
by another coercion provider.value - A value to coerce, typically a String.type - The type to convert to.type or ICallHandler.UNHANDLED if this provider does not handle
the coercion.java.lang.Object toBindingValue(java.lang.Object value)
value parameter to a value suitable for a Bindings e.g., a JSON bindings.
It is imperative that this method coerces only between the JSON types and Java types it explicitly
handles otherwise you may inadvertently perform a coercion that is incorrect that is better handled
by another coercion provider.value - A value to coerce.Bindings or ICallHandler.UNHANDLED
if this provider does not handle the coercion. For example, the coerced value is typically a String when dealing
with JSON Schema formats such as "date-time" where the value persists in the bindings as a String, but
surfaces as a java.time.LocalDateTime in the Java API.Copyright © 2022. All rights reserved.