KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > validate > FlagPropertyId


1 package com.thaiopensource.validate;
2
3 import com.thaiopensource.validate.Flag;
4 import com.thaiopensource.util.PropertyId;
5 import com.thaiopensource.util.PropertyMapBuilder;
6
7 /**
8  * A PropertyId whose value is not significant. Its significance
9  * rests purely on whether it is present in a PropertyMap. The
10  * value is constrained to be Flag.PRESENT.
11  *
12  * @see Flag
13  */

14 public class FlagPropertyId extends PropertyId {
15   public FlagPropertyId(String JavaDoc name) {
16     super(name, Flag.class);
17   }
18
19   /**
20    * Adds this property to a PropertyMapBuilder. Modifies
21    * the PropertyMapBuilder so that this PropertyId is
22    * mapped to Flag.PRESENT.
23    *
24    * @param builder the PropertyMapBuilder to be modified
25    */

26   public void add(PropertyMapBuilder builder) {
27     builder.put(this, Flag.PRESENT);
28   }
29 }
30
Popular Tags