KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > classfile > analysis > ClassInfo


1 /*
2  * FindBugs - Find Bugs in Java programs
3  * Copyright (C) 2006, University of Maryland
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package edu.umd.cs.findbugs.classfile.analysis;
21
22 import edu.umd.cs.findbugs.classfile.ClassDescriptor;
23 import edu.umd.cs.findbugs.classfile.FieldDescriptor;
24 import edu.umd.cs.findbugs.classfile.ICodeBaseEntry;
25 import edu.umd.cs.findbugs.classfile.MethodDescriptor;
26
27 /**
28  * ClassInfo represents important metadata about a
29  * loaded class, such as its superclass, access flags, codebase entry,
30  * etc.
31  *
32  * @author David Hovemeyer
33  */

34 public class ClassInfo extends ClassNameAndSuperclassInfo {
35     private FieldDescriptor[] fieldDescriptorList;
36     private MethodDescriptor[] methodDescriptorList;
37     private ClassDescriptor[] referencedClassDescriptorList;
38     
39     /**
40      * Constructor.
41      * Does not initialize any fields; setters should be called
42      * before the object is used.
43      */

44     public ClassInfo() {
45     }
46     
47     /**
48      *
49      * @param classDescriptor ClassDescriptor representing the class name
50      * @param superclassDescriptor ClassDescriptor representing the superclass name
51      * @param interfaceDescriptorList ClassDescriptors representing implemented interface names
52      * @param codeBaseEntry codebase entry class was loaded from
53      * @param accessFlags class's access flags
54      * @param fieldDescriptorList FieldDescriptors of fields defined in the class
55      * @param methodDescriptorList MethodDescriptors of methods defined in the class
56      * @param referencedClassDescriptorList ClassDescriptors of all classes/interfaces referenced by the class
57      */

58     public ClassInfo(
59             ClassDescriptor classDescriptor,
60             ClassDescriptor superclassDescriptor,
61             ClassDescriptor[] interfaceDescriptorList,
62             ICodeBaseEntry codeBaseEntry,
63             int accessFlags,
64             FieldDescriptor[] fieldDescriptorList,
65             MethodDescriptor[] methodDescriptorList,
66             ClassDescriptor[] referencedClassDescriptorList) {
67         super(classDescriptor, superclassDescriptor, interfaceDescriptorList, codeBaseEntry, accessFlags);
68         this.fieldDescriptorList = fieldDescriptorList;
69         this.methodDescriptorList = methodDescriptorList;
70         this.referencedClassDescriptorList = referencedClassDescriptorList;
71     }
72     
73     /**
74      * @return Returns the fieldDescriptorList.
75      */

76     public FieldDescriptor[] getFieldDescriptorList() {
77         return fieldDescriptorList;
78     }
79     
80     /**
81      * @return Returns the methodDescriptorList.
82      */

83     public MethodDescriptor[] getMethodDescriptorList() {
84         return methodDescriptorList;
85     }
86     
87     /**
88      * @return Returns the referencedClassDescriptorList.
89      */

90     public ClassDescriptor[] getReferencedClassDescriptorList() {
91         return referencedClassDescriptorList;
92     }
93
94     /**
95      * @param fieldDescriptorList The fieldDescriptorList to set.
96      */

97     public void setFieldDescriptorList(FieldDescriptor[] fieldDescriptorList) {
98         this.fieldDescriptorList = fieldDescriptorList;
99     }
100
101     /**
102      * @param methodDescriptorList The methodDescriptorList to set.
103      */

104     public void setMethodDescriptorList(MethodDescriptor[] methodDescriptorList) {
105         this.methodDescriptorList = methodDescriptorList;
106     }
107
108     /**
109      * @param referencedClassDescriptorList The referencedClassDescriptorList to set.
110      */

111     public void setReferencedClassDescriptorList(
112             ClassDescriptor[] referencedClassDescriptorList) {
113         this.referencedClassDescriptorList = referencedClassDescriptorList;
114     }
115 }
116
Popular Tags