KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > aspectwerkz > reflect > impl > java > JavaMemberInfo


1 /**************************************************************************************
2  * Copyright (c) Jonas Bonér, Alexandre Vasseur. All rights reserved. *
3  * http://aspectwerkz.codehaus.org *
4  * ---------------------------------------------------------------------------------- *
5  * The software in this package is published under the terms of the LGPL license *
6  * a copy of which has been included with this distribution in the license.txt file. *
7  **************************************************************************************/

8 package org.codehaus.aspectwerkz.reflect.impl.java;
9
10 import org.codehaus.aspectwerkz.reflect.ClassInfo;
11 import org.codehaus.aspectwerkz.reflect.MemberInfo;
12
13 import java.lang.reflect.Member JavaDoc;
14 import java.util.List JavaDoc;
15
16 /**
17  * @author <a HREF="mailto:jboner@codehaus.org">Jonas Bonér </a>
18  */

19 public abstract class JavaMemberInfo implements MemberInfo {
20     /**
21      * The member.
22      */

23     protected final Member JavaDoc m_member;
24
25     /**
26      * The declaring type.
27      */

28     protected final ClassInfo m_declaringType;
29
30     /**
31      * The attributes.
32      */

33     protected List JavaDoc m_annotations = null;
34
35     /**
36      * The class info repository.
37      */

38     protected final JavaClassInfoRepository m_classInfoRepository;
39
40     /**
41      * Creates a new member meta data instance.
42      *
43      * @param member
44      * @param declaringType
45      */

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

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

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

81     public ClassInfo getDeclaringType() {
82         return m_declaringType;
83     }
84 }
Popular Tags