|
|||||||||
| Home >> All >> org >> eclipse >> jdt >> internal >> [ compiler overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.jdt.internal.compiler
Class ClassFile

java.lang.Objectorg.eclipse.jdt.internal.compiler.ClassFile
- All Implemented Interfaces:
- org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants, org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants, org.eclipse.jdt.internal.compiler.lookup.CompilerModifiers, org.eclipse.jdt.internal.compiler.env.IConstants, org.eclipse.jdt.internal.compiler.lookup.TypeConstants, org.eclipse.jdt.internal.compiler.lookup.TypeIds
- public class ClassFile
- extends java.lang.Object
- implements org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants, org.eclipse.jdt.internal.compiler.lookup.CompilerModifiers, org.eclipse.jdt.internal.compiler.lookup.TypeConstants, org.eclipse.jdt.internal.compiler.lookup.TypeIds
- extends java.lang.Object
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
| Field Summary | |
org.eclipse.jdt.internal.compiler.codegen.CodeStream |
codeStream
|
org.eclipse.jdt.internal.compiler.codegen.ConstantPool |
constantPool
|
int |
constantPoolOffset
|
byte[] |
contents
|
int |
contentsOffset
|
protected boolean |
creatingProblemType
|
ClassFile |
enclosingClassFile
|
byte[] |
header
|
int |
headerOffset
|
static int |
INITIAL_CONTENTS_SIZE
|
static int |
INITIAL_HEADER_SIZE
|
static int |
INNER_CLASSES_SIZE
|
org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding[] |
innerClassesBindings
|
int |
methodCount
|
int |
methodCountOffset
|
int |
numberOfInnerClasses
|
boolean |
ownSharedArrays
|
int |
produceDebugAttributes
|
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding |
referenceBinding
|
long |
targetJDK
|
| Fields inherited from interface org.eclipse.jdt.internal.compiler.codegen.AttributeNamesConstants |
CodeName, ConstantValueName, DeprecatedName, ExceptionsName, InnerClassName, LineNumberTableName, LocalVariableTableName, SourceName, SyntheticName |
| Fields inherited from interface org.eclipse.jdt.internal.compiler.lookup.CompilerModifiers |
AccAlternateModifierProblem, AccBlankFinal, AccCatchesExceptions, AccClearPrivateModifier, AccDefault, AccDefaultAbstract, AccDeprecatedImplicitly, AccFromClassFile, AccImplementing, AccIsConstantValue, AccIsDefaultConstructor, AccJustFlag, AccModifierProblem, AccOverriding, AccPrivateUsed, AccProblem, AccSemicolonBody, AccThrowsExceptions, AccUnresolved, AccVisibilityMASK |
| Fields inherited from interface org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants |
ClassTag, ConstantClassFixedSize, ConstantDoubleFixedSize, ConstantFieldRefFixedSize, ConstantFloatFixedSize, ConstantIntegerFixedSize, ConstantInterfaceMethodRefFixedSize, ConstantLongFixedSize, ConstantMethodRefFixedSize, ConstantNameAndTypeFixedSize, ConstantStringFixedSize, ConstantUtf8FixedSize, DoubleTag, FieldRefTag, FloatTag, IntegerTag, InterfaceMethodRefTag, JDK_DEFERRED, JDK1_1, JDK1_2, JDK1_3, JDK1_4, JDK1_5, LongTag, MAJOR_VERSION_1_1, MAJOR_VERSION_1_2, MAJOR_VERSION_1_3, MAJOR_VERSION_1_4, MAJOR_VERSION_1_5, MethodRefTag, MINOR_VERSION_0, MINOR_VERSION_1, MINOR_VERSION_2, MINOR_VERSION_3, NameAndTypeTag, StringTag, Utf8Tag |
| Fields inherited from interface org.eclipse.jdt.internal.compiler.env.IConstants |
AccAbstract, AccBridge, AccDeprecated, AccFinal, AccInterface, AccNative, AccPrivate, AccProtected, AccPublic, AccStatic, AccStrictfp, AccSuper, AccSynchronized, AccSynthetic, AccTransient, AccVarargs, AccVolatile |
| Constructor Summary | |
ClassFile()
INTERNAL USE-ONLY This methods creates a new instance of the receiver. |
|
ClassFile(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding aType,
ClassFile enclosingClassFile,
boolean creatingProblemType)
INTERNAL USE-ONLY This methods creates a new instance of the receiver. |
|
| Method Summary | |
void |
addAbstractMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a boggus method. |
void |
addAttributes()
INTERNAL USE-ONLY This methods generate all the attributes for the receiver. |
void |
addDefaultAbstractMethods()
INTERNAL USE-ONLY This methods generate all the default abstract method infos that correpond to the abstract methods inherited from superinterfaces. |
void |
addFieldInfo(org.eclipse.jdt.internal.compiler.lookup.FieldBinding fieldBinding)
INTERNAL USE-ONLY This methods generates the bytes for the field binding passed like a parameter |
void |
addFieldInfos()
INTERNAL USE-ONLY This methods generate all the fields infos for the receiver. |
void |
addInnerClasses(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refBinding)
INTERNAL USE-ONLY This methods stores the bindings for each inner class. |
private void |
addMissingAbstractProblemMethod(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration methodDeclaration,
org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding,
org.eclipse.jdt.core.compiler.IProblem problem,
CompilationResult compilationResult)
|
void |
addProblemClinit(org.eclipse.jdt.core.compiler.IProblem[] problems)
INTERNAL USE-ONLY Generate the byte for a problem clinit method info that correspond to a boggus method. |
void |
addProblemConstructor(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding,
org.eclipse.jdt.core.compiler.IProblem[] problems)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a boggus constructor. |
void |
addProblemConstructor(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding,
org.eclipse.jdt.core.compiler.IProblem[] problems,
int savedOffset)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a boggus constructor. |
void |
addProblemMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding,
org.eclipse.jdt.core.compiler.IProblem[] problems)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a boggus method. |
void |
addProblemMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding,
org.eclipse.jdt.core.compiler.IProblem[] problems,
int savedOffset)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a boggus method. |
void |
addSpecialMethods()
INTERNAL USE-ONLY Generate the byte for all the special method infos. |
void |
addSyntheticConstructorAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding methodBinding)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a synthetic method that generate an access to a private constructor. |
void |
addSyntheticFieldReadAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding methodBinding)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a synthetic method that generate an read access to a private field. |
void |
addSyntheticFieldWriteAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding methodBinding)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a synthetic method that generate an write access to a private field. |
void |
addSyntheticMethodAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding methodBinding)
INTERNAL USE-ONLY Generate the byte for a problem method info that correspond to a synthetic method that generate an access to a private method. |
static java.lang.String |
buildAllDirectoriesInto(java.lang.String outputPath,
java.lang.String relativeFileName)
INTERNAL USE-ONLY Build all the directories and subdirectories corresponding to the packages names into the directory specified in parameters. |
void |
completeCodeAttribute(int codeAttributeOffset)
INTERNAL USE-ONLY That method completes the creation of the code attribute by setting - the attribute_length - max_stack - max_locals - code_length - exception table - and debug attributes if necessary. |
void |
completeCodeAttributeForClinit(int codeAttributeOffset)
INTERNAL USE-ONLY That method completes the creation of the code attribute by setting - the attribute_length - max_stack - max_locals - code_length - exception table - and debug attributes if necessary. |
void |
completeCodeAttributeForClinit(int codeAttributeOffset,
int[] startLineIndexes,
int problemLine)
INTERNAL USE-ONLY That method completes the creation of the code attribute by setting - the attribute_length - max_stack - max_locals - code_length - exception table - and debug attributes if necessary. |
void |
completeCodeAttributeForMissingAbstractProblemMethod(org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding,
int codeAttributeOffset,
int[] startLineIndexes,
int problemLine)
|
void |
completeCodeAttributeForProblemMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method,
org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding,
int codeAttributeOffset,
int[] startLineIndexes,
int problemLine)
INTERNAL USE-ONLY That method completes the creation of the code attribute by setting - the attribute_length - max_stack - max_locals - code_length - exception table - and debug attributes if necessary. |
void |
completeCodeAttributeForSyntheticAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding binding,
int codeAttributeOffset,
int[] startLineIndexes)
INTERNAL USE-ONLY That method completes the creation of the code attribute by setting - the attribute_length - max_stack - max_locals - code_length - exception table - and debug attributes if necessary. |
void |
completeMethodInfo(int methodAttributeOffset,
int attributeNumber)
INTERNAL USE-ONLY Complete the creation of a method info by setting up the number of attributes at the right offset. |
static void |
createProblemType(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration,
CompilationResult unitResult)
INTERNAL USE-ONLY Request the creation of a ClassFile compatible representation of a problematic type |
char[] |
fileName()
INTERNAL USE-ONLY This methods returns a char[] representing the file name of the receiver |
void |
generateCodeAttributeHeader()
INTERNAL USE-ONLY That method generates the header of a code attribute. |
int |
generateMethodInfoAttribute(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
INTERNAL USE-ONLY That method generates the attributes of a code attribute. |
void |
generateMethodInfoHeader(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
INTERNAL USE-ONLY That method generates the header of a method info: The header consists in: - the access flags - the name index of the method name inside the constant pool - the descriptor index of the signature of the method inside the constant pool. |
void |
generateMethodInfoHeader(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding,
int accessFlags)
INTERNAL USE-ONLY That method generates the header of a method info: The header consists in: - the access flags - the name index of the method name inside the constant pool - the descriptor index of the signature of the method inside the constant pool. |
void |
generateMethodInfoHeaderForClinit()
INTERNAL USE-ONLY That method generates the method info header of a clinit: The header consists in: - the access flags (always default access + static) - the name index of the method name (always |
void |
generateMissingAbstractMethods(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration[] methodDeclarations,
CompilationResult compilationResult)
INTERNAL USE-ONLY Generate the byte for problem method infos that correspond to missing abstract methods. |
byte[] |
getBytes()
EXTERNAL API Answer the actual bytes of the class file This method encodes the receiver structure into a byte array which is the content of the classfile. |
char[][] |
getCompoundName()
EXTERNAL API Answer the compound name of the class file. |
protected void |
initByteArrays()
|
ClassFile |
outerMostEnclosingClassFile()
INTERNAL USE-ONLY Returns the most enclosing classfile of the receiver. |
void |
recordEnclosingTypeAttributes(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
INTERNAL USE-ONLY This is used to store a new inner class. |
void |
recordNestedLocalAttribute(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
INTERNAL USE-ONLY This is used to store a new inner class. |
void |
recordNestedMemberAttribute(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
INTERNAL USE-ONLY This is used to store a new inner class. |
private void |
resizeContents(int minimalSize)
Resize the pool contents |
static int |
searchLineNumber(int[] startLineIndexes,
int position)
INTERNAL USE-ONLY Search the line number corresponding to a specific position |
void |
setForMethodInfos()
INTERNAL USE-ONLY This methods leaves the space for method counts recording. |
static void |
writeToDisk(boolean generatePackagesStructure,
java.lang.String outputPath,
java.lang.String relativeFileName,
byte[] contents)
INTERNAL USE-ONLY outputPath is formed like: c:\temp\ the last character is a file separator relativeFileName is formed like: java\lang\String.class |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
referenceBinding
public org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding referenceBinding
constantPool
public org.eclipse.jdt.internal.compiler.codegen.ConstantPool constantPool
enclosingClassFile
public ClassFile enclosingClassFile
produceDebugAttributes
public int produceDebugAttributes
innerClassesBindings
public org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding[] innerClassesBindings
numberOfInnerClasses
public int numberOfInnerClasses
header
public byte[] header
contents
public byte[] contents
headerOffset
public int headerOffset
contentsOffset
public int contentsOffset
constantPoolOffset
public int constantPoolOffset
methodCountOffset
public int methodCountOffset
methodCount
public int methodCount
creatingProblemType
protected boolean creatingProblemType
INITIAL_CONTENTS_SIZE
public static final int INITIAL_CONTENTS_SIZE
- See Also:
- Constant Field Values
INITIAL_HEADER_SIZE
public static final int INITIAL_HEADER_SIZE
- See Also:
- Constant Field Values
ownSharedArrays
public boolean ownSharedArrays
INNER_CLASSES_SIZE
public static final int INNER_CLASSES_SIZE
- See Also:
- Constant Field Values
codeStream
public org.eclipse.jdt.internal.compiler.codegen.CodeStream codeStream
targetJDK
public long targetJDK
| Constructor Detail |
ClassFile
public ClassFile()
- INTERNAL USE-ONLY
This methods creates a new instance of the receiver.
ClassFile
public ClassFile(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding aType, ClassFile enclosingClassFile, boolean creatingProblemType)
- INTERNAL USE-ONLY
This methods creates a new instance of the receiver.
| Method Detail |
addAbstractMethod
public void addAbstractMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a boggus method.
addAttributes
public void addAttributes()
- INTERNAL USE-ONLY
This methods generate all the attributes for the receiver.
For a class they could be:
- source file attribute
- inner classes attribute
- deprecated attribute
addDefaultAbstractMethods
public void addDefaultAbstractMethods()
- INTERNAL USE-ONLY
This methods generate all the default abstract method infos that correpond to
the abstract methods inherited from superinterfaces.
addFieldInfo
public void addFieldInfo(org.eclipse.jdt.internal.compiler.lookup.FieldBinding fieldBinding)
- INTERNAL USE-ONLY
This methods generates the bytes for the field binding passed like a parameter
addFieldInfos
public void addFieldInfos()
- INTERNAL USE-ONLY
This methods generate all the fields infos for the receiver.
This includes:
- a field info for each defined field of that class
- a field info for each synthetic field (e.g. this$0)
addInnerClasses
public void addInnerClasses(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refBinding)
- INTERNAL USE-ONLY
This methods stores the bindings for each inner class. They will be used to know which entries
have to be generated for the inner classes attributes.
addProblemClinit
public void addProblemClinit(org.eclipse.jdt.core.compiler.IProblem[] problems)
- INTERNAL USE-ONLY
Generate the byte for a problem clinit method info that correspond to a boggus method.
addProblemConstructor
public void addProblemConstructor(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding, org.eclipse.jdt.core.compiler.IProblem[] problems)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a boggus constructor.
addProblemConstructor
public void addProblemConstructor(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding, org.eclipse.jdt.core.compiler.IProblem[] problems, int savedOffset)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a boggus constructor.
Reset the position inside the contents byte array to the savedOffset.
addProblemMethod
public void addProblemMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding, org.eclipse.jdt.core.compiler.IProblem[] problems)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a boggus method.
addProblemMethod
public void addProblemMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding, org.eclipse.jdt.core.compiler.IProblem[] problems, int savedOffset)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a boggus method.
Reset the position inside the contents byte array to the savedOffset.
addSpecialMethods
public void addSpecialMethods()
- INTERNAL USE-ONLY
Generate the byte for all the special method infos.
They are:
- synthetic access methods
- default abstract methods
generateMissingAbstractMethods
public void generateMissingAbstractMethods(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration[] methodDeclarations, CompilationResult compilationResult)
- INTERNAL USE-ONLY
Generate the byte for problem method infos that correspond to missing abstract methods.
http://dev.eclipse.org/bugs/show_bug.cgi?id=3179
addMissingAbstractProblemMethod
private void addMissingAbstractProblemMethod(org.eclipse.jdt.internal.compiler.ast.MethodDeclaration methodDeclaration, org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding, org.eclipse.jdt.core.compiler.IProblem problem, CompilationResult compilationResult)
completeCodeAttributeForMissingAbstractProblemMethod
public void completeCodeAttributeForMissingAbstractProblemMethod(org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding, int codeAttributeOffset, int[] startLineIndexes, int problemLine)
addSyntheticConstructorAccessMethod
public void addSyntheticConstructorAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding methodBinding)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a synthetic method that
generate an access to a private constructor.
addSyntheticFieldReadAccessMethod
public void addSyntheticFieldReadAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding methodBinding)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a synthetic method that
generate an read access to a private field.
addSyntheticFieldWriteAccessMethod
public void addSyntheticFieldWriteAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding methodBinding)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a synthetic method that
generate an write access to a private field.
addSyntheticMethodAccessMethod
public void addSyntheticMethodAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding methodBinding)
- INTERNAL USE-ONLY
Generate the byte for a problem method info that correspond to a synthetic method that
generate an access to a private method.
buildAllDirectoriesInto
public static java.lang.String buildAllDirectoriesInto(java.lang.String outputPath, java.lang.String relativeFileName) throws java.io.IOException
- INTERNAL USE-ONLY
Build all the directories and subdirectories corresponding to the packages names
into the directory specified in parameters.
outputPath is formed like:
c:\temp\ the last character is a file separator
relativeFileName is formed like:
java\lang\String.class *
completeCodeAttribute
public void completeCodeAttribute(int codeAttributeOffset)
- INTERNAL USE-ONLY
That method completes the creation of the code attribute by setting
- the attribute_length
- max_stack
- max_locals
- code_length
- exception table
- and debug attributes if necessary.
completeCodeAttributeForClinit
public void completeCodeAttributeForClinit(int codeAttributeOffset)
- INTERNAL USE-ONLY
That method completes the creation of the code attribute by setting
- the attribute_length
- max_stack
- max_locals
- code_length
- exception table
- and debug attributes if necessary.
completeCodeAttributeForClinit
public void completeCodeAttributeForClinit(int codeAttributeOffset,
int[] startLineIndexes,
int problemLine)
- INTERNAL USE-ONLY
That method completes the creation of the code attribute by setting
- the attribute_length
- max_stack
- max_locals
- code_length
- exception table
- and debug attributes if necessary.
completeCodeAttributeForProblemMethod
public void completeCodeAttributeForProblemMethod(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration method, org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding, int codeAttributeOffset, int[] startLineIndexes, int problemLine)
- INTERNAL USE-ONLY
That method completes the creation of the code attribute by setting
- the attribute_length
- max_stack
- max_locals
- code_length
- exception table
- and debug attributes if necessary.
completeCodeAttributeForSyntheticAccessMethod
public void completeCodeAttributeForSyntheticAccessMethod(org.eclipse.jdt.internal.compiler.lookup.SyntheticAccessMethodBinding binding, int codeAttributeOffset, int[] startLineIndexes)
- INTERNAL USE-ONLY
That method completes the creation of the code attribute by setting
- the attribute_length
- max_stack
- max_locals
- code_length
- exception table
- and debug attributes if necessary.
completeMethodInfo
public void completeMethodInfo(int methodAttributeOffset,
int attributeNumber)
- INTERNAL USE-ONLY
Complete the creation of a method info by setting up the number of attributes at the right offset.
createProblemType
public static void createProblemType(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration, CompilationResult unitResult)
- INTERNAL USE-ONLY
Request the creation of a ClassFile compatible representation of a problematic type
fileName
public char[] fileName()
- INTERNAL USE-ONLY
This methods returns a char[] representing the file name of the receiver
generateCodeAttributeHeader
public void generateCodeAttributeHeader()
- INTERNAL USE-ONLY
That method generates the header of a code attribute.
- the index inside the constant pool for the attribute name ("Code")
- leave some space for attribute_length(4), max_stack(2), max_locals(2), code_length(4).
generateMethodInfoAttribute
public int generateMethodInfoAttribute(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
- INTERNAL USE-ONLY
That method generates the attributes of a code attribute.
They could be:
- an exception attribute for each try/catch found inside the method
- a deprecated attribute
- a synthetic attribute for synthetic access methods
It returns the number of attributes created for the code attribute.
generateMethodInfoHeader
public void generateMethodInfoHeader(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
- INTERNAL USE-ONLY
That method generates the header of a method info:
The header consists in:
- the access flags
- the name index of the method name inside the constant pool
- the descriptor index of the signature of the method inside the constant pool.
generateMethodInfoHeader
public void generateMethodInfoHeader(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding, int accessFlags)
- INTERNAL USE-ONLY
That method generates the header of a method info:
The header consists in:
- the access flags
- the name index of the method name inside the constant pool
- the descriptor index of the signature of the method inside the constant pool.
generateMethodInfoHeaderForClinit
public void generateMethodInfoHeaderForClinit()
- INTERNAL USE-ONLY
That method generates the method info header of a clinit:
The header consists in:
- the access flags (always default access + static)
- the name index of the method name (always
) inside the constant pool - the descriptor index of the signature (always ()V) of the method inside the constant pool.
getBytes
public byte[] getBytes()
- EXTERNAL API
Answer the actual bytes of the class file
This method encodes the receiver structure into a byte array which is the content of the classfile.
Returns the byte array that represents the encoded structure of the receiver.
getCompoundName
public char[][] getCompoundName()
- EXTERNAL API
Answer the compound name of the class file.
initByteArrays
protected void initByteArrays()
outerMostEnclosingClassFile
public ClassFile outerMostEnclosingClassFile()
- INTERNAL USE-ONLY
Returns the most enclosing classfile of the receiver. This is used know to store the constant pool name
for all inner types of the receiver.
recordEnclosingTypeAttributes
public void recordEnclosingTypeAttributes(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
- INTERNAL USE-ONLY
This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the
collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.
recordNestedLocalAttribute
public void recordNestedLocalAttribute(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
- INTERNAL USE-ONLY
This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the
collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.
recordNestedMemberAttribute
public void recordNestedMemberAttribute(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
- INTERNAL USE-ONLY
This is used to store a new inner class. It checks that the binding @binding doesn't already exist inside the
collection of inner classes. Add all the necessary classes in the right order to fit to the specifications.
resizeContents
private final void resizeContents(int minimalSize)
- Resize the pool contents
searchLineNumber
public static final int searchLineNumber(int[] startLineIndexes,
int position)
- INTERNAL USE-ONLY
Search the line number corresponding to a specific position
setForMethodInfos
public void setForMethodInfos()
- INTERNAL USE-ONLY
This methods leaves the space for method counts recording.
writeToDisk
public static void writeToDisk(boolean generatePackagesStructure,
java.lang.String outputPath,
java.lang.String relativeFileName,
byte[] contents)
throws java.io.IOException
- INTERNAL USE-ONLY
outputPath is formed like:
c:\temp\ the last character is a file separator
relativeFileName is formed like:
java\lang\String.class
|
|||||||||
| Home >> All >> org >> eclipse >> jdt >> internal >> [ compiler overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.eclipse.jdt.internal.compiler.ClassFile