KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > aspectwerkz > reflect > impl > java > JavaMemberInfo


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.aspectwerkz.reflect.impl.java;
5
6
7 import java.lang.reflect.Member JavaDoc;
8 import java.util.List JavaDoc;
9
10 import com.tc.aspectwerkz.reflect.ClassInfo;
11 import com.tc.aspectwerkz.reflect.MemberInfo;
12
13 /**
14  * @author <a HREF="mailto:jboner@codehaus.org">Jonas BonŽr </a>
15  */

16 public abstract class JavaMemberInfo implements MemberInfo {
17   /**
18    * The member.
19    */

20   protected final Member JavaDoc m_member;
21
22   /**
23    * The declaring type.
24    */

25   protected final ClassInfo m_declaringType;
26
27   /**
28    * The attributes.
29    */

30   protected List JavaDoc m_annotations = null;
31
32   /**
33    * The class info repository.
34    */

35   protected final JavaClassInfoRepository m_classInfoRepository;
36
37   /**
38    * Creates a new member meta data instance.
39    *
40    * @param member
41    * @param declaringType
42    */

43   JavaMemberInfo(final Member JavaDoc member, final JavaClassInfo declaringType) {
44     if (member == null) {
45       throw new IllegalArgumentException JavaDoc("member can not be null");
46     }
47     if (declaringType == null) {
48       throw new IllegalArgumentException JavaDoc("declaring type can not be null");
49     }
50     m_member = member;
51     m_declaringType = declaringType;
52     m_classInfoRepository = JavaClassInfoRepository.getRepository(member.getDeclaringClass().getClassLoader());
53   }
54
55   /**
56    * Returns the name.
57    *
58    * @return the name
59    */

60   public String JavaDoc getName() {
61     return m_member.getName();
62   }
63
64   /**
65    * Returns the modifiers.
66    *
67    * @return the modifiers
68    */

69   public int getModifiers() {
70     return m_member.getModifiers();
71   }
72
73   /**
74    * Returns the declaring type.
75    *
76    * @return the declaring type
77    */

78   public ClassInfo getDeclaringType() {
79     return m_declaringType;
80   }
81 }
Popular Tags