KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > validator > RuleSetRef


1 package org.sapia.validator;
2
3
4 /**
5  * This class models a reference to a <code>RuleSet</code>.
6  *
7  * @author Yanick Duchesne
8  * <dl>
9  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
10  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
11  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
12  * </dl>
13  */

14 public class RuleSetRef implements Validatable {
15   private String JavaDoc _ref;
16
17   /**
18    * Constructor for RuleSetRef.
19    */

20   public RuleSetRef() {
21   }
22
23   /**
24    * Sets the identifier of the rule set to which this instance
25    * refers.
26    *
27    * @param ref the identifier of the referred <code>RuleSet</code>.
28    */

29   public void setId(String JavaDoc ref) {
30     _ref = ref;
31   }
32
33   /**
34    * Returns the identifier of the rule set to which this instance
35    * refers.
36    *
37    * @return the identifier of the <code>RuleSet</code> to which this instance
38    * refers.
39    */

40   public String JavaDoc getId() {
41     return _ref;
42   }
43
44   /**
45    * @see org.sapia.validator.Validatable#validate(ValidationContext)
46    */

47   public void validate(ValidationContext ctx) {
48     ctx.getConfig().getRuleSet(_ref).validate(ctx);
49   }
50 }
51
Popular Tags