Logo Search packages:      
Sourcecode: ecj version File versions

org::eclipse::jdt::internal::compiler::ClassFile Class Reference

Inheritance diagram for org::eclipse::jdt::internal::compiler::ClassFile:

List of all members.


Detailed Description

Represents a class file wrapper on bytes, it is aware of its actual type name.

Public APIs are listed below:

byte[] getBytes(); Answer the actual bytes of the class file

char[][] getCompoundName(); Answer the compound name of the class file. For example, {{java}, {util}, {Hashtable}}.

byte[] getReducedBytes(); Answer a smaller byte format, which is only contains some structural information. Those bytes are decodable with a regular class file reader, such as DietClassFileReader

Definition at line 88 of file ClassFile.java.


Public Member Functions

void addAbstractMethod (AbstractMethodDeclaration method, MethodBinding methodBinding)
void addAttributes ()
void addDefaultAbstractMethods ()
void addFieldInfos ()
void addProblemClinit (CategorizedProblem[] problems)
void addProblemConstructor (AbstractMethodDeclaration method, MethodBinding methodBinding, CategorizedProblem[] problems, int savedOffset)
void addProblemConstructor (AbstractMethodDeclaration method, MethodBinding methodBinding, CategorizedProblem[] problems)
void addProblemMethod (AbstractMethodDeclaration method, MethodBinding methodBinding, CategorizedProblem[] problems, int savedOffset)
void addProblemMethod (AbstractMethodDeclaration method, MethodBinding methodBinding, CategorizedProblem[] problems)
void addSpecialMethods ()
void addSyntheticConstructorAccessMethod (SyntheticMethodBinding methodBinding)
void addSyntheticEnumValueOfMethod (SyntheticMethodBinding methodBinding)
void addSyntheticEnumValuesMethod (SyntheticMethodBinding methodBinding)
void addSyntheticFieldReadAccessMethod (SyntheticMethodBinding methodBinding)
void addSyntheticFieldWriteAccessMethod (SyntheticMethodBinding methodBinding)
void addSyntheticMethodAccessMethod (SyntheticMethodBinding methodBinding)
void addSyntheticSwitchTable (SyntheticMethodBinding methodBinding)
 ClassFile (SourceTypeBinding typeBinding)
void completeCodeAttribute (int codeAttributeOffset)
void completeCodeAttributeForClinit (int codeAttributeOffset, int problemLine)
void completeCodeAttributeForClinit (int codeAttributeOffset)
void completeCodeAttributeForMissingAbstractProblemMethod (MethodBinding binding, int codeAttributeOffset, int[] startLineIndexes, int problemLine)
void completeCodeAttributeForProblemMethod (AbstractMethodDeclaration method, MethodBinding binding, int codeAttributeOffset, int[] startLineIndexes, int problemLine)
void completeCodeAttributeForSyntheticMethod (SyntheticMethodBinding binding, int codeAttributeOffset, int[] startLineIndexes)
void completeCodeAttributeForSyntheticMethod (boolean hasExceptionHandlers, SyntheticMethodBinding binding, int codeAttributeOffset, int[] startLineIndexes)
void completeMethodInfo (int methodAttributeOffset, int attributeNumber)
char[] fileName ()
void generateCodeAttributeHeader ()
int generateMethodInfoAttribute (MethodBinding methodBinding, boolean createProblemMethod)
int generateMethodInfoAttribute (MethodBinding methodBinding, AnnotationMethodDeclaration declaration)
int generateMethodInfoAttribute (MethodBinding methodBinding)
void generateMethodInfoHeader (MethodBinding methodBinding, int accessFlags)
void generateMethodInfoHeader (MethodBinding methodBinding)
void generateMethodInfoHeaderForClinit ()
void generateMissingAbstractMethods (MethodDeclaration[] methodDeclarations, CompilationResult compilationResult)
byte[] getBytes ()
char[][] getCompoundName ()
void initialize (SourceTypeBinding aType, ClassFile parentClassFile, boolean createProblemType)
ClassFile outerMostEnclosingClassFile ()
void recordEnclosingTypeAttributes (ReferenceBinding binding)
void recordNestedLocalAttribute (ReferenceBinding binding)
void recordNestedMemberAttribute (ReferenceBinding binding)
void reset (SourceTypeBinding typeBinding)
void setForMethodInfos ()

Static Public Member Functions

static String buildAllDirectoriesInto (String outputPath, String relativeFileName) throws IOException
static void createProblemType (TypeDeclaration typeDeclaration, CompilationResult unitResult)
static ClassFile getNewInstance (SourceTypeBinding typeBinding)
static final int searchLineNumber (int[] startLineIndexes, int position)
static void writeToDisk (boolean generatePackagesStructure, String outputPath, String relativeFileName, ClassFile classFile) throws IOException

Public Attributes

char[] ANNOTATION = "annotation".toCharArray()
char[] ANNOTATION_PREFIX = "@".toCharArray()
char[] ANNOTATION_SUFFIX = "()".toCharArray()
char[] ANONYM_PREFIX = "new ".toCharArray()
char[] ANONYM_SUFFIX = "(){}".toCharArray()
char[] BOOLEAN = "boolean".toCharArray()
final int Boolean2Boolean = T_boolean + (T_boolean << 4)
final int Boolean2Int = T_boolean + (T_int << 4)
final int Boolean2String = T_boolean + (T_JavaLangString << 4)
final int BOXING = 0x200
char[] BYTE = "byte".toCharArray()
final int Byte2Byte = T_byte + (T_byte << 4)
final int Byte2Char = T_byte + (T_char << 4)
final int Byte2Double = T_byte + (T_double << 4)
final int Byte2Float = T_byte + (T_float << 4)
final int Byte2Int = T_byte + (T_int << 4)
final int Byte2Long = T_byte + (T_long << 4)
final int Byte2Short = T_byte + (T_short << 4)
final int Byte2String = T_byte + (T_JavaLangString << 4)
char[] CHAR = "char".toCharArray()
final int Char2Byte = T_char + (T_byte << 4)
final int Char2Char = T_char + (T_char << 4)
final int Char2Double = T_char + (T_double << 4)
final int Char2Float = T_char + (T_float << 4)
final int Char2Int = T_char + (T_int << 4)
final int Char2Long = T_char + (T_long << 4)
final int Char2Short = T_char + (T_short << 4)
final int Char2String = T_char + (T_JavaLangString << 4)
char[] CharArray_JAVA_IO_OBJECTINPUTSTREAM = "java.io.ObjectInputStream".toCharArray()
char[] CharArray_JAVA_IO_OBJECTOUTPUTSTREAM = "java.io.ObjectOutputStream".toCharArray()
char[] CharArray_JAVA_IO_OBJECTSTREAMFIELD = "java.io.ObjectStreamField".toCharArray()
char[] CharArray_JAVA_LANG_ANNOTATION_ANNOTATION = "java.lang.annotation.Annotation".toCharArray()
char[] CharArray_JAVA_LANG_ENUM = "java.lang.Enum".toCharArray()
char[] CharArray_JAVA_LANG_OBJECT = "java.lang.Object".toCharArray()
char[] CLINIT = "<clinit>".toCharArray()
char[] CLONE = "clone".toCharArray()
CodeStream codeStream
ConstantPool constantPool
int constantPoolOffset
int CONSTRAINT_EQUAL = 0
int CONSTRAINT_EXTENDS = 1
int CONSTRAINT_SUPER = 2
byte[] contents
int contentsOffset
char[] DOUBLE = "double".toCharArray()
final int Double2Byte = T_double + (T_byte << 4)
final int Double2Char = T_double + (T_char << 4)
final int Double2Double = T_double + (T_double << 4)
final int Double2Float = T_double + (T_float << 4)
final int Double2Int = T_double + (T_int << 4)
final int Double2Long = T_double + (T_long << 4)
final int Double2Short = T_double + (T_short << 4)
final int Double2String = T_double + (T_JavaLangString << 4)
ClassFile enclosingClassFile
char[] FLOAT = "float".toCharArray()
final int Float2Byte = T_float + (T_byte << 4)
final int Float2Char = T_float + (T_char << 4)
final int Float2Double = T_float + (T_double << 4)
final int Float2Float = T_float + (T_float << 4)
final int Float2Int = T_float + (T_int << 4)
final int Float2Long = T_float + (T_long << 4)
final int Float2Short = T_float + (T_short << 4)
final int Float2String = T_float + (T_JavaLangString << 4)
char[] GETCLASS = "getClass".toCharArray()
byte[] header
int headerOffset
char[] INIT = "<init>".toCharArray()
ReferenceBinding[] innerClassesBindings
char[] INT = "int".toCharArray()
final int Int2Byte = T_int + (T_byte << 4)
final int Int2Char = T_int + (T_char << 4)
final int Int2Double = T_int + (T_double << 4)
final int Int2Float = T_int + (T_float << 4)
final int Int2Int = T_int + (T_int << 4)
final int Int2Long = T_int + (T_long << 4)
final int Int2Short = T_int + (T_short << 4)
final int Int2String = T_int + (T_JavaLangString << 4)
char[] IO = "io".toCharArray()
boolean isShared = false
char[][] JAVA_IO = {JAVA, IO}
char[][] JAVA_IO_PRINTSTREAM = {JAVA, IO, "PrintStream".toCharArray()}
char[][] JAVA_IO_SERIALIZABLE = {JAVA, IO, "Serializable".toCharArray()}
char[][] JAVA_LANG = {JAVA, LANG}
char[][] JAVA_LANG_ANNOTATION_ANNOTATION = {JAVA, LANG, ANNOTATION, "Annotation".toCharArray()}
char[][] JAVA_LANG_ANNOTATION_DOCUMENTED = {JAVA, LANG, ANNOTATION, "Documented".toCharArray()}
char[][] JAVA_LANG_ANNOTATION_ELEMENTTYPE = {JAVA, LANG, ANNOTATION, "ElementType".toCharArray()}
char[][] JAVA_LANG_ANNOTATION_INHERITED = {JAVA, LANG, ANNOTATION, "Inherited".toCharArray()}
char[][] JAVA_LANG_ANNOTATION_RETENTION = {JAVA, LANG, ANNOTATION, "Retention".toCharArray()}
char[][] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = {JAVA, LANG, ANNOTATION, "RetentionPolicy".toCharArray()}
char[][] JAVA_LANG_ANNOTATION_TARGET = {JAVA, LANG, ANNOTATION, "Target".toCharArray()}
char[][] JAVA_LANG_ASSERTIONERROR = {JAVA, LANG, "AssertionError".toCharArray()}
char[][] JAVA_LANG_BOOLEAN = {JAVA, LANG, "Boolean".toCharArray()}
char[][] JAVA_LANG_BYTE = {JAVA, LANG, "Byte".toCharArray()}
char[][] JAVA_LANG_CHARACTER = {JAVA, LANG, "Character".toCharArray()}
char[][] JAVA_LANG_CLASS = {JAVA, LANG, "Class".toCharArray()}
char[][] JAVA_LANG_CLASSNOTFOUNDEXCEPTION = {JAVA, LANG, "ClassNotFoundException".toCharArray()}
char[][] JAVA_LANG_CLONEABLE = {JAVA, LANG, "Cloneable".toCharArray()}
char[][] JAVA_LANG_DEPRECATED = {JAVA, LANG, "Deprecated".toCharArray()}
char[][] JAVA_LANG_DOUBLE = {JAVA, LANG, "Double".toCharArray()}
char[][] JAVA_LANG_ENUM = {JAVA, LANG, "Enum".toCharArray()}
char[][] JAVA_LANG_ERROR = {JAVA, LANG, "Error".toCharArray()}
char[][] JAVA_LANG_EXCEPTION = {JAVA, LANG, "Exception".toCharArray()}
char[][] JAVA_LANG_FLOAT = {JAVA, LANG, "Float".toCharArray()}
char[][] JAVA_LANG_ILLEGALARGUMENTEXCEPTION = {JAVA, LANG, "IllegalArgumentException".toCharArray()}
char[][] JAVA_LANG_INTEGER = {JAVA, LANG, "Integer".toCharArray()}
char[][] JAVA_LANG_ITERABLE = {JAVA, LANG, "Iterable".toCharArray()}
char[][] JAVA_LANG_LONG = {JAVA, LANG, "Long".toCharArray()}
char[][] JAVA_LANG_NOCLASSDEFERROR = {JAVA, LANG, "NoClassDefError".toCharArray()}
char[][] JAVA_LANG_OBJECT = {JAVA, LANG, OBJECT}
char[][] JAVA_LANG_OVERRIDE = {JAVA, LANG, "Override".toCharArray()}
char[][] JAVA_LANG_REFLECT_CONSTRUCTOR = {JAVA, LANG, REFLECT, "Constructor".toCharArray()}
char[][] JAVA_LANG_REFLECT_FIELD = new char[][] {JAVA, LANG, REFLECT, "Field".toCharArray()}
char[][] JAVA_LANG_REFLECT_METHOD = new char[][] {JAVA, LANG, REFLECT, "Method".toCharArray()}
char[][] JAVA_LANG_RUNTIMEEXCEPTION = {JAVA, LANG, "RuntimeException".toCharArray()}
char[][] JAVA_LANG_SHORT = {JAVA, LANG, "Short".toCharArray()}
char[][] JAVA_LANG_STRING = {JAVA, LANG, "String".toCharArray()}
char[][] JAVA_LANG_STRINGBUFFER = {JAVA, LANG, "StringBuffer".toCharArray()}
char[][] JAVA_LANG_STRINGBUILDER = {JAVA, LANG, "StringBuilder".toCharArray()}
char[][] JAVA_LANG_SUPPRESSWARNINGS = {JAVA, LANG, "SuppressWarnings".toCharArray()}
char[][] JAVA_LANG_SYSTEM = {JAVA, LANG, "System".toCharArray()}
char[][] JAVA_LANG_THROWABLE = {JAVA, LANG, "Throwable".toCharArray()}
char[][] JAVA_LANG_VOID = {JAVA, LANG, "Void".toCharArray()}
char[][] JAVA_UTIL_ITERATOR = {JAVA, "util".toCharArray(), "Iterator".toCharArray()}
char[] LANG = "lang".toCharArray()
char[] LENGTH = "length".toCharArray()
char[] LONG = "long".toCharArray()
final int Long2Byte = T_long + (T_byte << 4)
final int Long2Char = T_long + (T_char << 4)
final int Long2Double = T_long + (T_double << 4)
final int Long2Float = T_long + (T_float << 4)
final int Long2Int = T_long + (T_int << 4)
final int Long2Long = T_long + (T_long << 4)
final int Long2Short = T_long + (T_short << 4)
final int Long2String = T_long + (T_JavaLangString << 4)
char[] MAIN = "main".toCharArray()
int methodCount
int methodCountOffset
int MISMATCH = 2
final int NoId = Integer.MAX_VALUE
char[] NULL = "null".toCharArray()
final int Null2String = T_null + (T_JavaLangString << 4)
int numberOfInnerClasses
char[] OBJECT = "Object".toCharArray()
final int Object2Object = T_JavaLangObject + (T_JavaLangObject << 4)
final int Object2String = T_JavaLangObject + (T_JavaLangString << 4)
int OK = 0
int produceAttributes
char[] READOBJECT = "readObject".toCharArray()
char[] READRESOLVE = "readResolve".toCharArray()
SourceTypeBinding referenceBinding
char[] REFLECT = "reflect".toCharArray()
char[] SERIALPERSISTENTFIELDS = "serialPersistentFields".toCharArray()
char[] SERIALVERSIONUID = "serialVersionUID".toCharArray()
char[] SHORT = "short".toCharArray()
final int Short2Byte = T_short + (T_byte << 4)
final int Short2Char = T_short + (T_char << 4)
final int Short2Double = T_short + (T_double << 4)
final int Short2Float = T_short + (T_float << 4)
final int Short2Int = T_short + (T_int << 4)
final int Short2Long = T_short + (T_long << 4)
final int Short2Short = T_short + (T_short << 4)
final int Short2String = T_short + (T_JavaLangString << 4)
final int String2String = T_JavaLangString + (T_JavaLangString << 4)
char[] SYNTHETIC_ACCESS_METHOD_PREFIX = "access$".toCharArray()
char[] SYNTHETIC_ASSERT_DISABLED = "$assertionsDisabled".toCharArray()
char[] SYNTHETIC_CLASS = "class$".toCharArray()
char[] SYNTHETIC_ENCLOSING_INSTANCE_PREFIX = "this$".toCharArray()
char[] SYNTHETIC_ENUM_VALUES = "ENUM$VALUES".toCharArray()
char[] SYNTHETIC_OUTER_LOCAL_PREFIX = "val$".toCharArray()
char[] SYNTHETIC_SWITCH_ENUM_TABLE = "$SWITCH_TABLE$".toCharArray()
final int T_boolean = 5
final int T_byte = 3
final int T_char = 2
final int T_double = 8
final int T_float = 9
final int T_int = 10
final int T_JavaIoPrintStream = 53
final int T_JavaIoSerializable = 37
final int T_JavaLangAnnotationAnnotation = 43
final int T_JavaLangAnnotationDocumented = 45
final int T_JavaLangAnnotationElementType = 52
final int T_JavaLangAnnotationInherited = 46
final int T_JavaLangAnnotationRetention = 48
final int T_JavaLangAnnotationRetentionPolicy = 51
final int T_JavaLangAnnotationTarget = 50
final int T_JavaLangAssertionError = 35
final int T_JavaLangBoolean = 33
final int T_JavaLangByte = 26
final int T_JavaLangCharacter = 28
final int T_JavaLangClass = 16
final int T_JavaLangClassNotFoundException = 23
final int T_JavaLangCloneable = 36
final int T_JavaLangDeprecated = 44
final int T_JavaLangDouble = 32
final int T_JavaLangEnum = 41
final int T_JavaLangError = 19
final int T_JavaLangException = 25
final int T_JavaLangFloat = 31
final int T_JavaLangIllegalArgumentException = 42
final int T_JavaLangInteger = 29
final int T_JavaLangIterable = 38
final int T_JavaLangLong = 30
final int T_JavaLangNoClassDefError = 22
final int T_JavaLangObject = 1
final int T_JavaLangOverride = 47
final int T_JavaLangReflectConstructor = 20
final int T_JavaLangReflectField = 54
final int T_JavaLangReflectMethod = 55
final int T_JavaLangRuntimeException = 24
final int T_JavaLangShort = 27
final int T_JavaLangString = 11
final int T_JavaLangStringBuffer = 17
final int T_JavaLangStringBuilder = 40
final int T_JavaLangSuppressWarnings = 49
final int T_JavaLangSystem = 18
final int T_JavaLangThrowable = 21
final int T_JavaLangVoid = 34
final int T_JavaUtilIterator = 39
final int T_long = 7
final int T_null = 12
final int T_short = 4
final int T_void = 6
long targetJDK
char[] TYPE = "TYPE".toCharArray()
final int UNBOXING = 0x400
int UNCHECKED = 1
char[] UPPER_ANNOTATION_TYPE = "ANNOTATION_TYPE".toCharArray()
char[] UPPER_CLASS = "CLASS".toCharArray()
char[] UPPER_CONSTRUCTOR = "CONSTRUCTOR".toCharArray()
char[] UPPER_FIELD = "FIELD".toCharArray()
char[] UPPER_LOCAL_VARIABLE = "LOCAL_VARIABLE".toCharArray()
char[] UPPER_METHOD = "METHOD".toCharArray()
char[] UPPER_PACKAGE = "PACKAGE".toCharArray()
char[] UPPER_PARAMETER = "PARAMETER".toCharArray()
char[] UPPER_RUNTIME = "RUNTIME".toCharArray()
char[] UPPER_SOURCE = "SOURCE".toCharArray()
char[] VALUE = "value".toCharArray()
char[] VALUEOF = "valueOf".toCharArray()
char[] VALUES = "values".toCharArray()
char[] VOID = "void".toCharArray()
char[] WILDCARD_CAPTURE = { '!' }
char[] WILDCARD_CAPTURE_NAME = "capture-of ".toCharArray()
char[] WILDCARD_EXTENDS = " extends ".toCharArray()
char[] WILDCARD_MINUS = { '-' }
char[] WILDCARD_NAME = { '?' }
char[] WILDCARD_PLUS = { '+' }
char[] WILDCARD_STAR = { '*' }
char[] WILDCARD_SUPER = " super ".toCharArray()
char[] WRITEOBJECT = "writeObject".toCharArray()
char[] WRITEREPLACE = "writeReplace".toCharArray()

Static Public Attributes

static final int COMPILE_TYPE_MASK = 0xF
static final int IMPLICIT_CONVERSION_MASK = 0xFF
static final int INITIAL_CONTENTS_SIZE = 400
static final int INITIAL_HEADER_SIZE = 1500
static final int INNER_CLASSES_SIZE = 5
static final char[] PACKAGE_INFO_NAME = "package-info".toCharArray()

Protected Member Functions

 ClassFile ()
void initByteArrays ()

Protected Attributes

boolean creatingProblemType

Package Attributes

char[] JAVA = "java".toCharArray()
final int T_undefined = 0

Private Member Functions

int addFieldAttributes (FieldBinding fieldBinding, int fieldAttributeOffset)
void addFieldInfo (FieldBinding fieldBinding)
void addInnerClasses (ReferenceBinding refBinding)
void addMissingAbstractProblemMethod (MethodDeclaration methodDeclaration, MethodBinding methodBinding, CategorizedProblem problem, CompilationResult compilationResult)
void generateAnnotation (Annotation annotation, int attributeOffset)
void generateElementValue (int attributeOffset, Expression defaultValue, Constant constant, TypeBinding binding)
void generateElementValue (Expression defaultValue, TypeBinding memberValuePairReturnType, int attributeOffset)
void generateElementValueForNonConstantExpression (Expression defaultValue, int attributeOffset, TypeBinding defaultValueBinding)
int generateRuntimeAnnotations (final Annotation[] annotations)
int generateRuntimeAnnotationsForParameters (Argument[] arguments)
boolean isRuntimeInvisible (Annotation annotation)
boolean isRuntimeVisible (Annotation annotation)
final void resizeContents (int minimalSize)

Private Attributes

byte[] bytes

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index