01: /*
02: * Project: BeautyJ - Customizable Java Source Code Transformer
03: * Class: de.gulden.util.javasource.Member
04: * Version: 1.0
05: *
06: * Date: 2002-10-27
07: *
08: * Note: Contains auto-generated Javadoc comments created by BeautyJ.
09: *
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: // --- constructor ---
41: // ------------------------------------------------------------------------
42: /**
43: * Creates a new instance of Member.
44: */
45: protected Member(Class c) {
46: setDeclaringClass(c);
47: }
48:
49: // ------------------------------------------------------------------------
50: // --- methods ---
51: // ------------------------------------------------------------------------
52: /**
53: * Returns the code.
54: */
55: public Code getCode() {
56: return code;
57: }
58:
59: /**
60: * Sets the code.
61: */
62: public void setCode(Code c) {
63: code = c;
64: }
65:
66: /**
67: * Returns the package of which this is a member.
68: */
69: public Package getPackage() {
70: return getDeclaringClass().getPackage();
71: }
72:
73: /**
74: * Initialize this object from parsed Java code.
75: */
76: void initFromAST(Node node) {
77: // get name
78: super .initFromAST(node); // sets unqualified name
79: String className = getDeclaringClass().getName();
80: name = className + "." + name;
81: }
82:
83: } // end Member
|