KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > gulden > util > javasource > Member


1 /*
2  * Project: BeautyJ - Customizable Java Source Code Transformer
3  * Class: de.gulden.util.javasource.Member
4  * Version: 1.0
5  *
6  * Date: 2002-10-27
7  *
8  * Note: Contains auto-generated Javadoc comments created by BeautyJ.
9  *
10  * This is licensed under the GNU General Public License (GPL)
11  * and comes with NO WARRANTY. See file license.txt for details.
12  *
13  * Author: Jens Gulden
14  * Email: beautyj@jensgulden.de
15  */

16
17 package de.gulden.util.javasource;
18
19 import de.gulden.util.javasource.jjt.*;
20 import java.io.*;
21 import java.util.*;
22
23 /**
24  * Class Member.
25  *
26  * @author Jens Gulden
27  * @version 1.0
28  */

29 public abstract class Member extends SourceObjectDeclaredVisible {
30
31     // ------------------------------------------------------------------------
32
// --- field ---
33
// ------------------------------------------------------------------------
34
/**
35      * The code.
36      */

37     public Code code;
38
39
40     // ------------------------------------------------------------------------
41
// --- constructor ---
42
// ------------------------------------------------------------------------
43
/**
44      * Creates a new instance of Member.
45      */

46     protected Member(Class JavaDoc c) {
47         setDeclaringClass(c);
48     }
49
50
51     // ------------------------------------------------------------------------
52
// --- methods ---
53
// ------------------------------------------------------------------------
54
/**
55      * Returns the code.
56      */

57     public Code getCode() {
58         return code;
59     }
60
61     /**
62      * Sets the code.
63      */

64     public void setCode(Code c) {
65         code=c;
66     }
67
68     /**
69      * Returns the package of which this is a member.
70      */

71     public Package JavaDoc getPackage() {
72         return getDeclaringClass().getPackage();
73     }
74
75     /**
76      * Initialize this object from parsed Java code.
77      */

78     void initFromAST(Node node) {
79         // get name
80
super.initFromAST(node); // sets unqualified name
81
String JavaDoc className=getDeclaringClass().getName();
82         name=className+"."+name;
83     }
84
85 } // end Member
86
Popular Tags