KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > bcel > generic > FieldOrMethodReference


1 //Tested with BCEL-5.1
2
//http://jakarta.apache.org/builds/jakarta-bcel/release/v5.1/
3

4 package com.puppycrawl.tools.checkstyle.bcel.generic;
5
6 import org.apache.bcel.generic.ConstantPoolGen;
7 import org.apache.bcel.generic.FieldOrMethod;
8 import org.apache.bcel.generic.ObjectType;
9
10 /**
11  * Describe class InstructionReference
12  * @author Rick Giles
13  * @version 18-Jun-2003
14  */

15 public class FieldOrMethodReference
16 {
17     protected FieldOrMethod mInstruction;
18     
19     protected ConstantPoolGen mPoolGen;
20     
21     protected FieldOrMethodReference(
22         FieldOrMethod aInstruction,
23         ConstantPoolGen aPoolGen)
24     {
25         mInstruction = aInstruction;
26         mPoolGen = aPoolGen;
27     }
28
29     /**
30      * @return
31      */

32     public FieldOrMethod getInstruction()
33     {
34         return mInstruction;
35     }
36     
37     public String JavaDoc getClassName()
38     {
39         return mInstruction.getClassName(mPoolGen);
40     }
41     
42     public ObjectType getClassType()
43     {
44         return mInstruction.getClassType(mPoolGen);
45     }
46     
47     public ObjectType getLoadClassType()
48     {
49         return mInstruction.getLoadClassType(mPoolGen);
50     }
51     
52     public String JavaDoc getName()
53     {
54         return mInstruction.getName(mPoolGen);
55     }
56     
57     public String JavaDoc toString()
58     {
59         return mInstruction.toString(mPoolGen.getConstantPool());
60     }
61 }
62
Popular Tags