Class FieldData<I,O>
- java.lang.Object
-
- org.spongepowered.configurate.objectmapping.FieldData<I,O>
-
- Type Parameters:
I
- intermediate typeO
- container type
public abstract class FieldData<I,O> extends java.lang.Object
Holder for field-specific information.- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FieldData.Deserializer<I>
A deserialization handler to appropriately place object data into fields.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
isValid(java.lang.Object instance)
Test if an object would be valid for this field.abstract java.lang.String
name()
The name of the field.abstract java.lang.reflect.AnnotatedType
resolvedType()
The calculated type of this field within the object type.@Nullable ConfigurationNode
resolveNode(ConfigurationNode source)
Use this field's node resolvers to determine a target node.void
validate(@Nullable java.lang.Object instance)
Try to ensure the provided value is acceptable.
-
-
-
Method Detail
-
name
public abstract java.lang.String name()
The name of the field.- Returns:
- field name
- Since:
- 4.0.0
-
resolvedType
public abstract java.lang.reflect.AnnotatedType resolvedType()
The calculated type of this field within the object type.This value has had any possible type parameters resolved using information available in the context.
- Returns:
- the resolved type
- Since:
- 4.0.0
-
isValid
public boolean isValid(java.lang.Object instance)
Test if an object would be valid for this field.- Parameters:
instance
- instance to validate- Returns:
- true if valid
- Since:
- 4.0.0
-
validate
public void validate(@Nullable java.lang.Object instance) throws SerializationException
Try to ensure the provided value is acceptable.- Parameters:
instance
- field value instance to validate- Throws:
SerializationException
- if validation fails- Since:
- 4.0.0
-
resolveNode
public @Nullable ConfigurationNode resolveNode(ConfigurationNode source)
Use this field's node resolvers to determine a target node.- Parameters:
source
- parent node- Returns:
- resolved node
- Since:
- 4.0.0
-
-