1 /*******************************************************************************
2  * Copyright (c) 2000, 2013 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  *     Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
11  *         bug 407191 - [1.8] Binary access support for type annotations
12  *******************************************************************************/
13 package org.eclipse.jdt.internal.compiler.env;
14 
15 import org.eclipse.jdt.core.compiler.CharOperation;
16 
17 public interface IBinaryType extends IGenericType {
18 
19 	char[][] NoInterface = CharOperation.NO_CHAR_CHAR;
20 	IBinaryNestedType[] NoNestedType = new IBinaryNestedType[0];
21 	IBinaryField[] NoField = new IBinaryField[0];
22 	IBinaryMethod[] NoMethod = new IBinaryMethod[0];
23 /**
24  * Answer the runtime visible and invisible annotations for this type or null if none.
25  */
26 
getAnnotations()27 IBinaryAnnotation[] getAnnotations();
28 
29 /**
30  * Answer the runtime visible and invisible type annotations for this type or null if none.
31  */
32 
getTypeAnnotations()33 IBinaryTypeAnnotation[] getTypeAnnotations();
34 
35 /**
36  * Answer the enclosing method (including method selector and method descriptor), or
37  * null if none.
38  *
39  * For example, "foo()Ljava/lang/Object;V"
40  */
41 
getEnclosingMethod()42 char[] getEnclosingMethod();
43 /**
44  * Answer the resolved name of the enclosing type in the
45  * class file format as specified in section 4.2 of the Java 2 VM spec
46  * or null if the receiver is a top level type.
47  *
48  * For example, java.lang.String is java/lang/String.
49  */
50 
getEnclosingTypeName()51 char[] getEnclosingTypeName();
52 /**
53  * Answer the receiver's fields or null if the array is empty.
54  */
55 
getFields()56 IBinaryField[] getFields();
57 /**
58  * Answer the receiver's signature which describes the parameter &
59  * return types as specified in section 4.4.4 of the Java 2 VM spec 3rd edition.
60  * Returns null if none.
61  *
62  * @return the receiver's signature, null if none
63  */
getGenericSignature()64 char[] getGenericSignature();
65 /**
66  * Answer the resolved names of the receiver's interfaces in the
67  * class file format as specified in section 4.2 of the Java 2 VM spec
68  * or null if the array is empty.
69  *
70  * For example, java.lang.String is java/lang/String.
71  */
72 
getInterfaceNames()73 char[][] getInterfaceNames();
74 /**
75  * Answer the receiver's nested types or null if the array is empty.
76  *
77  * This nested type info is extracted from the inner class attributes.
78  * Ask the name environment to find a member type using its compound name.
79  */
80 
81 // NOTE: The compiler examines the nested type info & ignores the local types
82 // so the local types do not have to be included.
83 
getMemberTypes()84 IBinaryNestedType[] getMemberTypes();
85 /**
86  * Answer the receiver's methods or null if the array is empty.
87  */
88 
getMethods()89 IBinaryMethod[] getMethods();
90 
91 /**
92  * Answer the list of missing type names which were referenced from
93  * the problem classfile. This list is encoded via an extra attribute.
94  */
getMissingTypeNames()95 char[][][] getMissingTypeNames();
96 
97 /**
98  * Answer the resolved name of the type in the
99  * class file format as specified in section 4.2 of the Java 2 VM spec.
100  *
101  * For example, java.lang.String is java/lang/String.
102  */
getName()103 char[] getName();
104 
105 /**
106  * Answer the simple name of the type in the class file.
107  * For member A$B, will answer B.
108  * For anonymous will answer null.
109  */
getSourceName()110 char[] getSourceName();
111 
112 /**
113  * Answer the resolved name of the receiver's superclass in the
114  * class file format as specified in section 4.2 of the Java 2 VM spec
115  * or null if it does not have one.
116  *
117  * For example, java.lang.String is java/lang/String.
118  */
119 
getSuperclassName()120 char[] getSuperclassName();
121 /**
122  * Answer the tagbits set according to the bits for annotations.
123  */
getTagBits()124 long getTagBits();
125 /**
126  * Answer true if the receiver is an anonymous class.
127  * false otherwise
128  */
isAnonymous()129 boolean isAnonymous();
130 
131 /**
132  * Answer true if the receiver is a local class.
133  * false otherwise
134  */
isLocal()135 boolean isLocal();
136 
137 /**
138  * Answer true if the receiver is a member class.
139  * false otherwise
140  */
isMember()141 boolean isMember();
142 
143 /**
144  * Answer the source file attribute, or null if none.
145  *
146  * For example, "String.java"
147  */
148 
sourceFileName()149 char[] sourceFileName();
150 
151 }
152