com.lotaris.jee.validation.IModifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jee-validation Show documentation
Show all versions of jee-validation Show documentation
This library offers components that facilitate validation of arbitrary objects and how they are serialized towards a client.
It focuses on the wiring of the proposed patterns and does not contain any concrete validator implementations.
package com.lotaris.jee.validation;
import com.lotaris.jee.validation.preprocessing.modifier.Trim;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
/**
* Modifiers are used when values need to be preprocessed, typically before validation. For example,
* strings must be trimmed before they are validated. A modifier is the implementation of such an
* operation.
*
* @author Simon Oulevay ([email protected])
* @see Trim
*/
public interface IModifier {
/**
* Returns the modifier annotation that this modifier implements.
*
* @return a modifier annotation
*/
Class extends Annotation> getAnnotationType();
/**
* Modifies the value of the specified field. The full object is given to support use cases
* where a modification may depend on the value of other fields.
*
* @param object the object
* @param field the field on which the modification must be applied
* @param annotation the annotation that was on the field
*/
void process(Object object, Field field, T annotation);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy