KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > bcel > classfile > FieldOrMethodDefinition


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.classfile;
5
6 import org.apache.bcel.classfile.FieldOrMethod;
7
8 /**
9  * Contains the definition of a Field or a Method.
10  * @author Rick Giles
11  */

12 public class FieldOrMethodDefinition
13 {
14     /** the Field or Method */
15     private FieldOrMethod mFieldOrMethod;
16
17     /**
18      * Constructs a <code>FieldOrMethodDefinition</code> for a Field
19      * or a Method.
20      * @param aFieldOrMethod the Field or Method
21      */

22     protected FieldOrMethodDefinition(FieldOrMethod aFieldOrMethod)
23     {
24         mFieldOrMethod = aFieldOrMethod;
25     }
26
27     /**
28      * Returns the FieldOrMethod.
29      * @return the FieldOrMethod.
30      */

31     protected FieldOrMethod getFieldOrMethod()
32     {
33         return mFieldOrMethod;
34     }
35
36     /**
37      * Returns the name of the Field or Method.
38      * @return the name of the Field or Method.
39      */

40     public String JavaDoc getName()
41     {
42         return mFieldOrMethod.getName();
43     }
44
45     /** @see java.lang.Object#toString() */
46     public String JavaDoc toString()
47     {
48         return mFieldOrMethod.toString();
49     }
50 }
51
Popular Tags