2015-06-05 11:43:53 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2015-06-08 17:23:39 +02:00
|
|
|
package org.gcube.accounting.datamodel.validations;
|
2015-06-05 11:43:53 +02:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
2015-06-05 12:54:26 +02:00
|
|
|
import org.gcube.accounting.exception.InvalidValueException;
|
|
|
|
|
2015-06-05 11:43:53 +02:00
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
|
|
|
*/
|
2015-06-05 18:50:07 +02:00
|
|
|
public interface FieldValidator {
|
2015-06-05 12:54:26 +02:00
|
|
|
|
2015-06-05 18:50:07 +02:00
|
|
|
/**
|
|
|
|
* Validate (and convert if needed) the provided property
|
|
|
|
* @param toValidate the property to validate
|
|
|
|
* @return the validated (and converted property)
|
|
|
|
* @throws InvalidValueException if the validation (or conversion) fails
|
|
|
|
*/
|
2015-06-05 12:54:26 +02:00
|
|
|
public Serializable validate(Serializable toValidate) throws InvalidValueException;
|
2015-06-05 11:43:53 +02:00
|
|
|
|
|
|
|
}
|