org.aspectj.org.eclipse.jdt.internal.core.util
Class ExtendedAnnotation

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileStruct
      extended by org.aspectj.org.eclipse.jdt.internal.core.util.ExtendedAnnotation
All Implemented Interfaces:
IAnnotation, IExtendedAnnotation

public class ExtendedAnnotation
extends ClassFileStruct
implements IExtendedAnnotation

Since:
3.10

Constructor Summary
ExtendedAnnotation(byte[] classFileBytes, IConstantPool constantPool, int offset)
          Constructor for ExtendedAnnotation, builds an annotation from the supplied bytestream.
 
Method Summary
 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.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileStruct
doubleAt, floatAt, i1At, i2At, i4At, i8At, u1At, u2At, u4At, utf8At
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedAnnotation

public ExtendedAnnotation(byte[] classFileBytes,
                          IConstantPool constantPool,
                          int offset)
                   throws ClassFormatException
Constructor for ExtendedAnnotation, builds an annotation from the supplied bytestream.

Parameters:
classFileBytes -
constantPool -
offset -
Throws:
ClassFormatException
Method Detail

getTypeIndex

public int getTypeIndex()
Description copied from interface: IAnnotation
Answer back the type index as described in the JVM specifications.

Specified by:
getTypeIndex in interface IAnnotation
Returns:
the type index

getComponentsNumber

public int getComponentsNumber()
Description copied from interface: IAnnotation
Answer back the number of components as described in the JVM specifications.

Specified by:
getComponentsNumber in interface IAnnotation
Returns:
the type index

getComponents

public IAnnotationComponent[] getComponents()
Description copied from interface: IAnnotation
Answer back the components as described in the JVM specifications. Answer an empty collection if none.

Specified by:
getComponents in interface IAnnotation
Returns:
the components

getTypeName

public char[] getTypeName()
Description copied from interface: IAnnotation
Answer back the type name as described in the JVM specifications.

Specified by:
getTypeName in interface IAnnotation
Returns:
the type name

getTargetType

public int getTargetType()
Description copied from interface: IExtendedAnnotation
Answer back the target type as described in the JVM specifications.

Specified by:
getTargetType in interface IExtendedAnnotation
Returns:
the target type

getExceptionTableIndex

public int getExceptionTableIndex()
Description copied from interface: IExtendedAnnotation
Answer back the exception table index when the target_type is EXCEPTION_PARAMETER.

Specified by:
getExceptionTableIndex in interface IExtendedAnnotation
Returns:
the exception table index

getOffset

public int getOffset()
Description copied from interface: IExtendedAnnotation
Answer back the offset. For a target_type value equals to:
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.

Specified by:
getOffset in interface IExtendedAnnotation
Returns:
the offset

getLocalVariableRefenceInfoLength

public int getLocalVariableRefenceInfoLength()
Description copied from interface: IExtendedAnnotation
Answer back the local variable reference info table length of this entry as specified in the JVM specifications.

This is defined only for annotations related to a local variable.

Specified by:
getLocalVariableRefenceInfoLength in interface IExtendedAnnotation
Returns:
the local variable reference info table length of this entry as specified in the JVM specifications

getLocalVariableTable

public ILocalVariableReferenceInfo[] getLocalVariableTable()
Description copied from interface: IExtendedAnnotation
Answer back the local variable reference info table of this entry as specified in the JVM specifications. Answer an empty array if none.

This is defined only for annotations related to a local variable.

Specified by:
getLocalVariableTable in interface IExtendedAnnotation
Returns:
the local variable reference info table of this entry as specified in the JVM specifications. Answer an empty array if none

getParameterIndex

public int getParameterIndex()
Description copied from interface: IExtendedAnnotation
Answer back the method parameter index.

The index is 0-based.

Specified by:
getParameterIndex in interface IExtendedAnnotation
Returns:
the method parameter index

getTypeParameterIndex

public int getTypeParameterIndex()
Description copied from interface: IExtendedAnnotation
Answer back the index of the type parameter of the class or method

The index is 0-based.

Specified by:
getTypeParameterIndex in interface IExtendedAnnotation
Returns:
the index of the type parameter of the class or method

getTypeParameterBoundIndex

public int getTypeParameterBoundIndex()
Description copied from interface: IExtendedAnnotation
Answer back the index of the bound of the type parameter of the method or class

The index is 0-based.

Specified by:
getTypeParameterBoundIndex in interface IExtendedAnnotation
Returns:
the index of the bound of the type parameter of the method or class

getTypePath

public int[][] getTypePath()
Description copied from interface: IExtendedAnnotation
Answer back the locations of the annotated type as described in the JVM specifications.

This is used for parameterized and array types.

Specified by:
getTypePath in interface IExtendedAnnotation
Returns:
the locations of the annotated type

getAnnotationTypeIndex

public int getAnnotationTypeIndex()
Description copied from interface: IExtendedAnnotation
Answer back the index in the given different situations.

The 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

Specified by:
getAnnotationTypeIndex in interface IExtendedAnnotation
Returns:
the index in the given different situations