Class MethodInfo
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileStruct
org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.MethodInfo
- All Implemented Interfaces:
Comparable
,IBinaryMethod
,IGenericMethod
- Direct Known Subclasses:
AnnotationMethodInfo
,MethodInfoWithAnnotations
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected char[][]
protected int
protected char[]
protected char[][]
protected char[]
protected char[]
protected int
protected long
protected long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MethodInfo(byte[] classFileBytes, int[] offsets, int offset, long version)
-
Method Summary
Modifier and TypeMethodDescriptionint
static MethodInfo
createMethod(byte[] classFileBytes, int[] offsets, int offset, long version)
boolean
int
Answer the number of parameter annotations that can be retrieved usingIBinaryMethod.getParameterAnnotations(int, char[])
.Answer the runtime visible and invisible annotations for this method or null if none.char[][]
Answer the names of the argument or null if the argument names are not available.ReturnClassSignature
for a ClassClass
.char[][]
Answer the resolved names of the exception types in the class file format as specified in section 4.2 of the Java 2 VM spec or null if the array is empty.char[]
Answer the receiver's MethodSignature, which describes the type parameters, parameter types, return type, and exception types as specified in "4.7.9.1 Signatures" of the Java SE 8 VM spec.char[]
Answer the receiver's method descriptor which describes the parameter & return types as specified in section 4.4.3 of the Java 2 VM spec.int
Answer an int whose bits are set according the access constants defined by the VM spec.getParameterAnnotations(int index, char[] classFileName)
Answer the annotations on theindex
th parameter or null if nonechar[]
Answer the name of the method.long
Answer the tagbits set according to the bits for annotations.Answer the type annotations on this method.int
hashCode()
protected void
This method is used to fully initialize the contents of the receiver.boolean
isClinit()
Answer true if the method is a class initializer, false otherwise.boolean
Answer true if the method is a constructor, false otherwise.boolean
Return true if the field is a synthetic method, false otherwise.int
Answer the size of the receiver in bytes.toString()
protected void
toStringContent(StringBuffer buffer)
-
Field Details
-
accessFlags
protected int accessFlags -
attributeBytes
protected int attributeBytes -
descriptor
protected char[] descriptor -
exceptionNames
protected volatile char[][] exceptionNames -
name
protected char[] name -
signature
protected char[] signature -
signatureUtf8Offset
protected int signatureUtf8Offset -
tagBits
protected long tagBits -
argumentNames
protected volatile char[][] argumentNames -
version
protected long version
-
-
Constructor Details
-
MethodInfo
protected MethodInfo(byte[] classFileBytes, int[] offsets, int offset, long version)- Parameters:
classFileBytes
- byte[]offsets
- int[]offset
- intversion
- class file version
-
-
Method Details
-
createMethod
public static MethodInfo createMethod(byte[] classFileBytes, int[] offsets, int offset, long version) -
compareTo
- Specified by:
compareTo
in interfaceComparable
-
equals
-
hashCode
public int hashCode() -
getAnnotations
Description copied from interface:IBinaryMethod
Answer the runtime visible and invisible annotations for this method or null if none.- Specified by:
getAnnotations
in interfaceIBinaryMethod
-
getArgumentNames
public char[][] getArgumentNames()Description copied from interface:IGenericMethod
Answer the names of the argument or null if the argument names are not available.- Specified by:
getArgumentNames
in interfaceIGenericMethod
- See Also:
IGenericMethod.getArgumentNames()
-
getDefaultValue
Description copied from interface:IBinaryMethod
ReturnClassSignature
for a ClassClass
. ReturnConstant
for compile-time constant of primitive type, as well as String literals. ReturnEnumConstantSignature
if value is an enum constant. ReturnIBinaryAnnotation
for annotation type. ReturnObject
[] for array type.- Specified by:
getDefaultValue
in interfaceIBinaryMethod
- Returns:
- default value of this annotation method
-
getExceptionTypeNames
public char[][] getExceptionTypeNames()Description copied from interface:IBinaryMethod
Answer the resolved names of the exception types in the class file format as specified in section 4.2 of the Java 2 VM spec or null if the array is empty. For example, java.lang.String is java/lang/String.- Specified by:
getExceptionTypeNames
in interfaceIBinaryMethod
-
getGenericSignature
public char[] getGenericSignature()Description copied from interface:IBinaryMethod
Answer the receiver's MethodSignature, which describes the type parameters, parameter types, return type, and exception types as specified in "4.7.9.1 Signatures" of the Java SE 8 VM spec.- Specified by:
getGenericSignature
in interfaceIBinaryMethod
-
getMethodDescriptor
public char[] getMethodDescriptor()Description copied from interface:IBinaryMethod
Answer the receiver's method descriptor which describes the parameter & return types as specified in section 4.4.3 of the Java 2 VM spec. For example: - int foo(String) is (Ljava/lang/String;)I - Object[] foo(int) is (I)[Ljava/lang/Object;- Specified by:
getMethodDescriptor
in interfaceIBinaryMethod
-
getModifiers
public int getModifiers()Answer an int whose bits are set according the access constants defined by the VM spec. Set the AccDeprecated and AccSynthetic bits if necessary- Specified by:
getModifiers
in interfaceIGenericMethod
- Returns:
- int
-
getParameterAnnotations
Description copied from interface:IBinaryMethod
Answer the annotations on theindex
th parameter or null if none- Specified by:
getParameterAnnotations
in interfaceIBinaryMethod
- Parameters:
index
- the index of the parameter of interestclassFileName
- (file) name of the declaring class for error reporting
-
getAnnotatedParametersCount
public int getAnnotatedParametersCount()Description copied from interface:IBinaryMethod
Answer the number of parameter annotations that can be retrieved usingIBinaryMethod.getParameterAnnotations(int, char[])
.- Specified by:
getAnnotatedParametersCount
in interfaceIBinaryMethod
- Returns:
- one beyond the highest legal argument to
IBinaryMethod.getParameterAnnotations(int, char[])
.
-
getTypeAnnotations
Description copied from interface:IBinaryMethod
Answer the type annotations on this method.- Specified by:
getTypeAnnotations
in interfaceIBinaryMethod
-
getSelector
public char[] getSelector()Description copied from interface:IBinaryMethod
Answer the name of the method. For a constructor, answer& for a clinit method. - Specified by:
getSelector
in interfaceIBinaryMethod
-
getTagBits
public long getTagBits()Description copied from interface:IBinaryMethod
Answer the tagbits set according to the bits for annotations.- Specified by:
getTagBits
in interfaceIBinaryMethod
-
initialize
protected void initialize()This method is used to fully initialize the contents of the receiver. All methodinfos, fields infos will be therefore fully initialized and we can get rid of the bytes. -
isClinit
public boolean isClinit()Answer true if the method is a class initializer, false otherwise.- Specified by:
isClinit
in interfaceIBinaryMethod
- Returns:
- boolean
-
isConstructor
public boolean isConstructor()Answer true if the method is a constructor, false otherwise.- Specified by:
isConstructor
in interfaceIGenericMethod
- Returns:
- boolean
-
isSynthetic
public boolean isSynthetic()Return true if the field is a synthetic method, false otherwise.- Returns:
- boolean
-
sizeInBytes
public int sizeInBytes()Answer the size of the receiver in bytes.- Returns:
- int
-
toString
-
toStringContent
-