Interface TypeSerializer.Annotated<V>
-
- Type Parameters:
V
- the value type
- All Superinterfaces:
TypeSerializer<V>
- All Known Implementing Classes:
AbstractListChildSerializer
,ScalarSerializer
,ScalarSerializer.Annotated
- Enclosing interface:
- TypeSerializer<T>
public static interface TypeSerializer.Annotated<V> extends TypeSerializer<V>
A type serializer that prefers type use annotation metadata to deserialize the type.- Since:
- 4.2.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.configurate.serialize.TypeSerializer
TypeSerializer.Annotated<V>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description V
deserialize(java.lang.reflect.AnnotatedType type, ConfigurationNode node)
Deserialize an object (of the correct type) from the given configuration node.default V
deserialize(java.lang.reflect.Type type, ConfigurationNode node)
Deserialize an object (of the correct type) from the given configuration node.default @Nullable V
emptyValue(java.lang.reflect.AnnotatedType specificType, ConfigurationOptions options)
Create an empty value of the appropriate type.default @Nullable V
emptyValue(java.lang.reflect.Type specificType, ConfigurationOptions options)
Create an empty value of the appropriate type.void
serialize(java.lang.reflect.AnnotatedType type, @Nullable V obj, ConfigurationNode node)
Serialize an object to the given configuration node.default void
serialize(java.lang.reflect.Type type, @Nullable V obj, ConfigurationNode node)
Serialize an object to the given configuration node.
-
-
-
Method Detail
-
deserialize
V deserialize(java.lang.reflect.AnnotatedType type, ConfigurationNode node) throws SerializationException
Description copied from interface:TypeSerializer
Deserialize an object (of the correct type) from the given configuration node.- Specified by:
deserialize
in interfaceTypeSerializer<V>
- Parameters:
type
- the annotated type of return value requirednode
- the node containing serialized data- Returns:
- an object
- Throws:
SerializationException
- if the presented data is invalid
-
deserialize
default V deserialize(java.lang.reflect.Type type, ConfigurationNode node) throws SerializationException
Description copied from interface:TypeSerializer
Deserialize an object (of the correct type) from the given configuration node.- Specified by:
deserialize
in interfaceTypeSerializer<V>
- Parameters:
type
- the type of return value requirednode
- the node containing serialized data- Returns:
- an object
- Throws:
SerializationException
- if the presented data is invalid
-
serialize
void serialize(java.lang.reflect.AnnotatedType type, @Nullable V obj, ConfigurationNode node) throws SerializationException
Description copied from interface:TypeSerializer
Serialize an object to the given configuration node.- Specified by:
serialize
in interfaceTypeSerializer<V>
- Parameters:
type
- the annotated type of the input objectobj
- the object to be serializednode
- the node to write to- Throws:
SerializationException
- if the object cannot be serialized
-
serialize
default void serialize(java.lang.reflect.Type type, @Nullable V obj, ConfigurationNode node) throws SerializationException
Description copied from interface:TypeSerializer
Serialize an object to the given configuration node.- Specified by:
serialize
in interfaceTypeSerializer<V>
- Parameters:
type
- the type of the input objectobj
- the object to be serializednode
- the node to write to- Throws:
SerializationException
- if the object cannot be serialized
-
emptyValue
default @Nullable V emptyValue(java.lang.reflect.AnnotatedType specificType, ConfigurationOptions options)
Description copied from interface:TypeSerializer
Create an empty value of the appropriate type.This method is for the most part designed to create empty collection types, though it may be useful for scalars in limited cases.
- Specified by:
emptyValue
in interfaceTypeSerializer<V>
- Parameters:
specificType
- specific annotated subtype to create an empty value ofoptions
- options used from the loading node- Returns:
- new empty value
-
emptyValue
default @Nullable V emptyValue(java.lang.reflect.Type specificType, ConfigurationOptions options)
Description copied from interface:TypeSerializer
Create an empty value of the appropriate type.This method is for the most part designed to create empty collection types, though it may be useful for scalars in limited cases.
- Specified by:
emptyValue
in interfaceTypeSerializer<V>
- Parameters:
specificType
- specific subtype to create an empty value ofoptions
- options used from the loading node- Returns:
- new empty value
-
-