25 lines
522 B
Java
25 lines
522 B
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.accounting.datamodel.validators;
|
|
|
|
import java.io.Serializable;
|
|
import java.lang.annotation.Annotation;
|
|
|
|
import org.gcube.accounting.exception.InvalidValueException;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
|
*
|
|
*/
|
|
public interface FieldValidator<T extends Annotation> {
|
|
|
|
Class<T> annotation();
|
|
|
|
public boolean isValid(Serializable toValidate);
|
|
|
|
public Serializable validate(Serializable toValidate) throws InvalidValueException;
|
|
|
|
String getErrorSuffix();
|
|
}
|