KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > aop > CachedAttribute


1 /*
2 * JBoss, the OpenSource J2EE webOS
3 *
4 * Distributable under LGPL license.
5 * See terms of license at gnu.org.
6 */

7 package org.jboss.cache.aop;
8
9 import java.lang.reflect.Method JavaDoc;
10
11 /**
12  * Class represent a class attribute. Currently not in use.
13  * @author <a HREF="mailto:harald@gliebe.de">Harald Gliebe</a>
14  * @author Ben Wang
15  */

16
17 public class CachedAttribute
18 {
19
20    protected String JavaDoc name;
21    protected Class JavaDoc type;
22    protected Method JavaDoc get, set;
23
24    public CachedAttribute()
25    {
26    }
27
28    public CachedAttribute(String JavaDoc name)
29    {
30       this.name = name;
31    }
32
33    public String JavaDoc getName()
34    {
35       return this.name;
36    }
37
38    public Class JavaDoc getType()
39    {
40       return this.type;
41    }
42
43    public void setType(Class JavaDoc type)
44    {
45       if (this.type != null && this.type != type) {
46          // TODO: provide better info
47
throw new IllegalArgumentException JavaDoc("get/set types differ");
48       }
49       this.type = type;
50    }
51
52    public Method JavaDoc getGet()
53    {
54       return this.get;
55    }
56
57    public void setGet(Method JavaDoc get)
58    {
59       this.get = get;
60    }
61
62    public Method JavaDoc getSet()
63    {
64       return this.set;
65    }
66
67    public void setSet(Method JavaDoc set)
68    {
69       this.set = set;
70    }
71
72 } // CachedAttribute
73
Popular Tags