KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.thaiopensource.validate;
2
3 import com.thaiopensource.util.PropertyId;
4
5 public class StringOption implements Option {
6   private final StringPropertyId pid;
7
8   public StringOption(StringPropertyId pid) {
9     this.pid = pid;
10   }
11
12   public PropertyId getPropertyId() {
13     return pid;
14   }
15
16   public Object JavaDoc valueOf(String JavaDoc arg) throws OptionArgumentException {
17     if (arg == null)
18       return defaultValue();
19     return normalize(arg);
20   }
21
22   public String JavaDoc defaultValue() throws OptionArgumentPresenceException {
23     throw new OptionArgumentPresenceException();
24   }
25
26   public String JavaDoc normalize(String JavaDoc value) throws OptionArgumentFormatException {
27     return value;
28   }
29
30   public Object JavaDoc combine(Object JavaDoc[] values) {
31     return null;
32   }
33 }
34
Popular Tags