public class ExtendedAnnotation extends ClassFileStruct implements IExtendedAnnotation
| Constructor and Description |
|---|
ExtendedAnnotation(byte[] classFileBytes,
IConstantPool constantPool,
int offset)
Constructor for ExtendedAnnotation, builds an annotation from the supplied bytestream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAnnotationTypeIndex()
Answer back the index in the given different situations.
|
IAnnotationComponent[] |
getComponents()
Answer back the components as described in the JVM specifications.
|
int |
getComponentsNumber()
Answer back the number of components as described in the JVM specifications.
|
int |
getExceptionTableIndex()
Answer back the exception table index when the target_type is EXCEPTION_PARAMETER.
|
int |
getLocalVariableRefenceInfoLength()
Answer back the local variable reference info table length of this entry as specified in
the JVM specifications.
|
ILocalVariableReferenceInfo[] |
getLocalVariableTable()
Answer back the local variable reference info table of this entry as specified in
the JVM specifications.
|
int |
getOffset()
Answer back the offset.
|
int |
getParameterIndex()
Answer back the method parameter index.
|
int |
getTargetType()
Answer back the target type as described in the JVM specifications.
|
int |
getTypeIndex()
Answer back the type index as described in the JVM specifications.
|
char[] |
getTypeName()
Answer back the type name as described in the JVM specifications.
|
int |
getTypeParameterBoundIndex()
Answer back the index of the bound of the type parameter of the method or class
|
int |
getTypeParameterIndex()
Answer back the index of the type parameter of the class or method
|
int[][] |
getTypePath()
Answer back the locations of the annotated type as described in the JVM specifications.
|
public ExtendedAnnotation(byte[] classFileBytes,
IConstantPool constantPool,
int offset)
throws ClassFormatException
classFileBytes - constantPool - offset - ClassFormatExceptionpublic int getTypeIndex()
IAnnotationgetTypeIndex in interface IAnnotationpublic int getComponentsNumber()
IAnnotationgetComponentsNumber in interface IAnnotationpublic IAnnotationComponent[] getComponents()
IAnnotationgetComponents in interface IAnnotationpublic char[] getTypeName()
IAnnotationgetTypeName in interface IAnnotationpublic int getTargetType()
IExtendedAnnotationgetTargetType in interface IExtendedAnnotationpublic int getExceptionTableIndex()
IExtendedAnnotationgetExceptionTableIndex in interface IExtendedAnnotationpublic int getOffset()
IExtendedAnnotation| target_type | offset description |
|---|---|
| 0x43 (INSTANCE_OF), 0x44 (NEW), 0x45 (CONSTRUCTOR_REFERENCE), 0x46 (METHOD_REFERENCE) | The offset within the bytecodes of the instanceof bytecode for INSTANCE_OF,
the new bytecode for NEW and the implementing instruction for either a
CONSTRUCTOR_REFERENCE or METHOD_REFERENCE. |
| 0x47 (CAST), 0x48 (CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT), 0x49 (METHOD_INVOCATION_TYPE_ARGUMENT), 0x4A (CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT), 0x4B (METHOD_REFERENCE_TYPE_ARGUMENT) | The offset within the bytecodes of the new bytecode for constructor call, or the
relevant bytecode for method invocation or method reference. For CAST the offset may
point to the checkcast or another instruction as it is possible the cast
may have been discarded by the compiler if it were a no-op. |
getOffset in interface IExtendedAnnotationpublic int getLocalVariableRefenceInfoLength()
IExtendedAnnotationThis is defined only for annotations related to a local variable.
getLocalVariableRefenceInfoLength in interface IExtendedAnnotationpublic ILocalVariableReferenceInfo[] getLocalVariableTable()
IExtendedAnnotationThis is defined only for annotations related to a local variable.
getLocalVariableTable in interface IExtendedAnnotationpublic int getParameterIndex()
IExtendedAnnotationThe index is 0-based.
getParameterIndex in interface IExtendedAnnotationpublic int getTypeParameterIndex()
IExtendedAnnotationThe index is 0-based.
getTypeParameterIndex in interface IExtendedAnnotationpublic int getTypeParameterBoundIndex()
IExtendedAnnotationThe index is 0-based.
getTypeParameterBoundIndex in interface IExtendedAnnotationpublic int[][] getTypePath()
IExtendedAnnotationThis is used for parameterized and array types.
getTypePath in interface IExtendedAnnotationpublic int getAnnotationTypeIndex()
IExtendedAnnotationThe index is 0-based.
| target_type | offset description |
|---|---|
| 0x10 (CLASS_EXTENDS) | the index of the type in the clause: -1 (65535) is used if the annotation is on
the superclass type, and the value i is used if the annotation is on the ith
superinterface type (counting from zero). |
| 0x17 (THROWS) | the index of the exception type in the clause: the value i denotes an annotation of the
ith exception type (counting from zero). |
| 0x47 (CAST), 0x48 (CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT), 0x49 (METHOD_INVOCATION_TYPE_ARGUMENT), 0x4A (CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT), 0x4B (METHOD_REFERENCE_TYPE_ARGUMENT) | the type argument index in the expression |
getAnnotationTypeIndex in interface IExtendedAnnotation