Package org.hibernate.type.format
Interface FormatMapper
- All Known Implementing Classes:
AbstractJsonFormatMapper,JacksonJsonFormatMapper,JacksonOsonFormatMapper,JacksonXmlFormatMapper,JaxbXmlFormatMapper,JsonBJsonFormatMapper
A mapper for mapping objects to and from a format.
- A
FormatMapperfor JSON may be selected using the configuration property "hibernate.type.json_format_mapper". - A
FormatMapperfor XML may be selected using the configuration property "hibernate.type.xml_format_mapper".
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> TfromString(CharSequence charSequence, JavaType<T> javaType, WrapperOptions wrapperOptions) Deserializes an object from the character sequence.default <T> TreadFromSource(JavaType<T> javaType, Object source, WrapperOptions options) default booleansupportsSourceType(Class<?> sourceType) Checks that this mapper supports a type as a source type.default booleansupportsTargetType(Class<?> targetType) Checks that this mapper supports a type as a target type.<T> StringtoString(T value, JavaType<T> javaType, WrapperOptions wrapperOptions) Serializes the object to a string.default <T> voidwriteToTarget(T value, JavaType<T> javaType, Object target, WrapperOptions options)
-
Method Details
-
fromString
Deserializes an object from the character sequence. -
toString
Serializes the object to a string. -
supportsSourceType
Checks that this mapper supports a type as a source type.- Parameters:
sourceType- the source type- Returns:
trueif the type is supported, false otherwise.
-
supportsTargetType
Checks that this mapper supports a type as a target type.- Parameters:
targetType- the target type- Returns:
trueif the type is supported, false otherwise.
-
writeToTarget
default <T> void writeToTarget(T value, JavaType<T> javaType, Object target, WrapperOptions options) throws IOException - Throws:
IOException
-
readFromSource
default <T> T readFromSource(JavaType<T> javaType, Object source, WrapperOptions options) throws IOException - Throws:
IOException
-