KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > factory > TypeDefinition


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.designer.factory;
5
6 import java.util.ArrayList JavaDoc;
7 import java.util.List JavaDoc;
8
9 import org.oddjob.arooa.SimpleObjectFactory;
10
11 /**
12  *
13  */

14 public class TypeDefinition {
15
16     private String JavaDoc tag;
17     private Class JavaDoc typeClass;
18     private List JavaDoc supports = new ArrayList JavaDoc();
19     
20     /**
21      * @return Returns the tag.
22      */

23     public String JavaDoc getTag() {
24         return tag;
25     }
26     /**
27      * @param tag The tag to set.
28      */

29     public void setTag(String JavaDoc tag) {
30         this.tag = tag;
31     }
32     /**
33      * @return Returns the className.
34      */

35     public String JavaDoc getClassname() {
36         return typeClass.getName();
37     }
38     /**
39      * @param className The className to set.
40      */

41     public void setClassname(String JavaDoc className) {
42         typeClass = SimpleObjectFactory.loadClass(className);
43         SimpleObjectFactory.checkTaskClass(typeClass);
44     }
45
46     public Class JavaDoc getTypeClass() {
47         return typeClass;
48     }
49     
50     public void addConfiguredSupports(Supports supports) {
51         this.supports.add(supports.type);
52     }
53     
54     public String JavaDoc[] getSupports() {
55         return (String JavaDoc[]) supports.toArray(new String JavaDoc[0]);
56     }
57     
58     public static class Supports {
59         String JavaDoc type;
60
61         public void setType(String JavaDoc type) {
62             this.type = type;
63         }
64     }
65 }
66
Popular Tags