View Javadoc

1   /** 2009, Digitalis Informatica. All rights reserved.
2    *
3    * Distribuicao e Gestao de Informatica, Lda.
4    * Estrada de Paco de Arcos num.9 - Piso -1
5    * 2780-666 Paco de Arcos
6    * Telefone: (351) 21 4408990
7    * Fax: (351) 21 4408999
8    * http://www.digitalis.pt
9    */
10  
11  package pt.digitalis.dif.dem.annotations.parameter;
12  
13  import java.lang.annotation.ElementType;
14  import java.lang.annotation.Retention;
15  import java.lang.annotation.RetentionPolicy;
16  import java.lang.annotation.Target;
17  
18  import pt.digitalis.dif.dem.annotations.AnnotationTags;
19  import pt.digitalis.dif.dem.annotations.metaannotations.BindToPrimary;
20  import pt.digitalis.dif.dem.objects.parameters.rules.ParameterRuleAction;
21  
22  
23  /**
24   * Rule association for a given parameter.
25   *
26   *
27   * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a><br/>
28   * @created Mar 31, 2009
29   */
30  @Target(ElementType.FIELD)
31  @Retention(RetentionPolicy.RUNTIME)
32  @BindToPrimary( { "pt.digitalis.dif.dem.annotations.parameter.Parameter" })
33  public @interface Rule {
34  
35      /** The ID of the corresponding rule. Any contributed parameter rule id. */
36      String ruleId();
37  
38      /** The parameter list. Comma separated if more than one */
39      String parameters();
40  
41      /** The value to compare */
42      String value() default AnnotationTags.NONE;
43  
44      /** The first value of the interval to validate */
45      String first() default AnnotationTags.NONE;
46  
47      /** The last value of the interval to validate */
48      String last() default AnnotationTags.NONE;
49  
50      /** the action to perform upon not validating */
51      ParameterRuleAction action() default ParameterRuleAction.HIDE;
52  
53  
54  }