KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > TypeComponentImpl


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdi.internal;
12
13
14 import com.sun.jdi.ReferenceType;
15 import com.sun.jdi.TypeComponent;
16
17 /**
18  * this class implements the corresponding interfaces
19  * declared by the JDI specification. See the com.sun.jdi package
20  * for more information.
21  *
22  */

23 public abstract class TypeComponentImpl extends AccessibleImpl implements TypeComponent {
24     /** Text representation of this type. */
25     private String JavaDoc fName = null;
26     /** JNI-style signature for this type. */
27     private String JavaDoc fSignature = null;
28     /** the generic signature for this type, java 1.5 */
29     private String JavaDoc fGenericSignature;
30     /** ReferenceType that holds field or method. */
31     private ReferenceTypeImpl fDeclaringType;
32     /** Modifier bits. */
33     protected int fModifierBits;
34
35     /**
36      * Creates new instance.
37      */

38     public TypeComponentImpl(String JavaDoc description, VirtualMachineImpl vmImpl, ReferenceTypeImpl declaringType, String JavaDoc name, String JavaDoc signature, String JavaDoc genericSignature, int modifierBits) {
39         super(description, vmImpl);
40         fName = name;
41         fSignature = signature;
42         fGenericSignature= genericSignature;
43         fDeclaringType= declaringType;
44         fModifierBits = modifierBits;
45     }
46
47     /**
48      * @return Returns modifier bits.
49      */

50     public int modifiers() {
51         return fModifierBits;
52     }
53     
54     /**
55      * @return Returns the ReferenceTypeImpl in which this component was declared.
56      */

57     public ReferenceTypeImpl referenceTypeImpl() {
58         return fDeclaringType;
59     }
60     
61     /**
62      * @return Returns the type in which this component was declared.
63      */

64     public ReferenceType declaringType() {
65         return fDeclaringType;
66     }
67     
68     /**
69      * @return Returns true if type component is final.
70      */

71     public boolean isFinal() {
72         return (fModifierBits & MODIFIER_ACC_FINAL) != 0;
73     }
74     
75     /**
76      * @return Returns true if type component is static.
77      */

78     public boolean isStatic() {
79         return (fModifierBits & MODIFIER_ACC_STATIC) != 0;
80     }
81     
82     /**
83      * @return Returns true if type component is synthetic.
84      */

85     public boolean isSynthetic() {
86         return (fModifierBits & (MODIFIER_SYNTHETIC | MODIFIER_ACC_SYNTHETIC)) != 0;
87     }
88     
89     /**
90      * @return Returns text representation of this type.
91      */

92     public String JavaDoc name() {
93         return fName;
94     }
95
96     /**
97      * @return JNI-style signature for this type.
98      */

99     public String JavaDoc signature() {
100         return fSignature;
101     }
102     
103     /**
104      * @return Returns description of Mirror object.
105      */

106     public String JavaDoc toString() {
107         return fName;
108     }
109     
110     public String JavaDoc genericSignature() {
111         return fGenericSignature;
112     }
113     
114 }
115
Popular Tags