Interface AnnotationValidator<T extends Annotation>
- Type Parameters:
T
- annotation type
public interface AnnotationValidator<T extends Annotation>
Represents a validator of a custom annotation.
- Since:
- 2.0.0
- Author:
- MrIvanPlays
-
Method Summary
Modifier and TypeMethodDescriptionAnnotationConfig calls this method whenever it finds the custom annotation this validator is bound to in order to determine whether the inputtedvalue
is valid for the custom annotation with which the inputtedField
field
was annotated.default Object
writeValue
(Object value) AnnotationConfig calls this method whenever it finds the custom annotation this validator is bound to in order to write thevalue
to a config.
-
Method Details
-
validate
AnnotationConfig calls this method whenever it finds the custom annotation this validator is bound to in order to determine whether the inputtedvalue
is valid for the custom annotation with which the inputtedField
field
was annotated.- Parameters:
annotation
- the annotation this validator validatesvalue
- the value AnnotationConfig receivedsettings
- the settings for the config resolverfield
- the annotated field- Returns:
- validation response
- See Also:
-
writeValue
AnnotationConfig calls this method whenever it finds the custom annotation this validator is bound to in order to write thevalue
to a config. Method is optional to implement, if it is not implemented, or returnsnull
, AnnotationConfig will write thevalue
in the default way it can.If the returned value is an object, for which there is a registered
FieldTypeSerializer
, it will serialize it accordingly.- Parameters:
value
- the value to write- Returns:
- an easier serializable value
-