View Javadoc

1   /**
2    * 
3    */
4   package pt.digitalis.dif.dem.objects.parameters.validators;
5   
6   import pt.digitalis.dif.controller.interfaces.IDIFContext;
7   
8   /**
9    * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a>
10   * @author Rodrigo Gonçalves <a href="mailto:rgoncalves@digitalis.pt">rgoncalves@digitalis.pt</a>
11   * @created Nov 16, 2007
12   * 
13   */
14  public interface IParameterValidator {
15  
16  	// TODO: Implement this feature
17  
18  	/**
19  	 * Validates the given value
20  	 * 
21  	 * @param value
22  	 *            the value to validate
23  	 * @param context
24  	 *            the context
25  	 * @return T if the validation has passed
26  	 */
27  	public boolean validate(Object value, IDIFContext context);
28  
29      /**
30       * Get a description on why the validation fails
31       * 
32       * @param language
33       *            the language on witch to create the error message
34       * @return the validation error message
35       */
36      public String validationErrorMessage(String language);
37  
38      /**
39       * Get a description on why the validation fails
40       * 
41       * @return the validation error message in the default language
42       */
43      public String validationErrorMessage();
44  }