Class TypeAnnotationsReader
java.lang.Object
com.ibm.wala.shrike.shrikeCT.AttributeReader
com.ibm.wala.shrike.shrikeCT.AnnotationsReader
com.ibm.wala.shrike.shrikeCT.TypeAnnotationsReader
This class reads TypeAnnotations attributes, i.e.: RuntimeInvisibleTypeAnnotations and
RuntimeVisibleTypeAnnotations
- Author:
- Martin Hecker martin.hecker@kit.edu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic classstatic classstatic classstatic classstatic classstatic enumPossible target_type items.static enumKnown target_types for JSR 308 Type-Annotation.static classstatic classstatic enumEnumeration of those Bytecode locations where type annotation may appear (in the corresponding attribute table).static classATypeAnnotationsReader.TypeAnnotationTargetrepresents one of the possible target_info structurestatic interfacestatic classstatic classstatic classstatic enumNested classes/interfaces inherited from class AnnotationsReader
AnnotationsReader.AnnotationAttribute, AnnotationsReader.ArrayElementValue, AnnotationsReader.ConstantElementValue, AnnotationsReader.ElementValue, AnnotationsReader.EnumElementValueModifier and TypeClassDescriptionstatic classRepresentation of an annotation attribute.static classrepresents an annotation argument that itself is an array of argumentsstatic classRepresents a constant argument to an annotation.static interfaceMarker interface for possible element values in an annotation attribute.static classRepresents enum constant annotation arguments. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<Pair<TypeAnnotationsReader.TypePathKind, Integer>> Fields inherited from class AnnotationsReader
beginOffsetModifier and TypeFieldDescriptionprotected final intoffset in class file where this attribute beginsFields inherited from class AttributeReader
attr, cr, lengthModifier and TypeFieldDescriptionprotected final intprotected final ClassReaderprotected final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTypeAnnotationsReader(ClassReader.AttrIterator iter, String label, ExceptionsReader exceptionReader, CodeReader codeReader, SignatureReader signatureReader, TypeAnnotationsReader.TypeAnnotationLocation location) -
Method Summary
Modifier and TypeMethodDescriptionstatic TypeAnnotationsReadergetReaderForAnnotationAtClassfile(TypeAnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter, SignatureReader signatureReader) static TypeAnnotationsReadergetReaderForAnnotationAtCode(TypeAnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter, CodeReader codereader) static TypeAnnotationsReadergetReaderForAnnotationAtFieldInfo(TypeAnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter) static TypeAnnotationsReadergetReaderForAnnotationAtMethodInfo(TypeAnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter, ExceptionsReader exceptionReader, SignatureReader signatureReader) static TypeAnnotationsReadergetTypeAnnotationReaderAtClassfile(ClassReader.AttrIterator iter, String label, SignatureReader signatureReader) static TypeAnnotationsReadergetTypeAnnotationReaderAtCode(ClassReader.AttrIterator iter, String label, CodeReader codeReader) static TypeAnnotationsReaderstatic TypeAnnotationsReadergetTypeAnnotationReaderAtMethodInfo(ClassReader.AttrIterator iter, String label, ExceptionsReader exceptionReader, SignatureReader signatureReader) static booleanisKnownAnnotation(String name) Methods inherited from class AnnotationsReader
getAllAnnotations, getAllParameterAnnotations, getAnnotationCount, getAttributeAndSize, getAttributeSize, getReaderForAnnotation, getUtf8ConstantPoolValue, readElementValueAndSizeModifier and TypeMethodDescriptionget all the annotations declared in this attribute.param_annotations { u2 attribute_name_index; u4 attribute_length; u1 num_parameters; { u2 num_annotations; annotation annotations[num_annotations]; } parameter_annotations[num_parameters];intprotected Pair<AnnotationsReader.AnnotationAttribute, Integer> getAttributeAndSize(int begin) annotation { u2 type_index; u2 num_element_value_pairs; { u2 element_name_index; element_value value; } element_value_pairs[num_element_value_pairs]intstatic AnnotationsReaderprotected StringgetUtf8ConstantPoolValue(int offset) get the Utf8 constant pool value, where the constant pool offset is given in the classprotected Pair<AnnotationsReader.ElementValue, Integer> readElementValueAndSize(int offset) element_value { u1 tag; union { u2 const_value_index; { u2 type_name_index; u2 const_name_index; } enum_const_value; u2 class_info_index; annotation annotation_value; { u2 num_values; element_value values[num_values]; } array_value; } value;Methods inherited from class AttributeReader
checkSize, checkSizeEquals, getClassReader, getRawOffset, getRawSizeModifier and TypeMethodDescriptionprotected final voidcheckSize(int offset, int len) Ensure that the len bytes starting at offset fall within the attribute data.protected final voidcheckSizeEquals(int offset, int len) Ensure that the len bytes starting at offset end at the end of the attribute data.final ClassReaderfinal intfinal int
-
Field Details
-
TYPEPATH_EMPTY
-
-
Constructor Details
-
TypeAnnotationsReader
protected TypeAnnotationsReader(ClassReader.AttrIterator iter, String label, ExceptionsReader exceptionReader, CodeReader codeReader, SignatureReader signatureReader, TypeAnnotationsReader.TypeAnnotationLocation location) throws InvalidClassFileException - Throws:
InvalidClassFileException
-
-
Method Details
-
getTypeAnnotationReaderAtClassfile
public static TypeAnnotationsReader getTypeAnnotationReaderAtClassfile(ClassReader.AttrIterator iter, String label, SignatureReader signatureReader) throws InvalidClassFileException - Returns:
- a TypeAnnotationReader for reading type annotations in the attributes table of a ClassFile structure
- Throws:
InvalidClassFileException
-
getTypeAnnotationReaderAtMethodInfo
public static TypeAnnotationsReader getTypeAnnotationReaderAtMethodInfo(ClassReader.AttrIterator iter, String label, ExceptionsReader exceptionReader, SignatureReader signatureReader) throws InvalidClassFileException - Returns:
- a TypeAnnotationReader for reading type annotations in the attributes table of a method_info structure
- Throws:
InvalidClassFileException
-
getTypeAnnotationReaderAtFieldInfo
public static TypeAnnotationsReader getTypeAnnotationReaderAtFieldInfo(ClassReader.AttrIterator iter, String label) throws InvalidClassFileException - Returns:
- a TypeAnnotationReader for reading type annotations in the attributes table of a field_info structure
- Throws:
InvalidClassFileException
-
getTypeAnnotationReaderAtCode
public static TypeAnnotationsReader getTypeAnnotationReaderAtCode(ClassReader.AttrIterator iter, String label, CodeReader codeReader) throws InvalidClassFileException - Returns:
- a TypeAnnotationReader for reading type annotations in the attributes table of a Code attribute
- Throws:
InvalidClassFileException
-
getAllTypeAnnotations
public TypeAnnotationsReader.TypeAnnotationAttribute[] getAllTypeAnnotations() throws InvalidClassFileException- Returns:
- an array TypeAnnotationAttribute[] corresponding to the annotations[num_annotations]
table specified as:
RuntimeVisibleTypeAnnotations_attribute { u2 attribute_name_index; u4 attribute_length; u2 num_annotations; type_annotation annotations[num_annotations]; } - Throws:
InvalidClassFileException- See Also:
-
isKnownAnnotation
-
getReaderForAnnotationAtClassfile
public static TypeAnnotationsReader getReaderForAnnotationAtClassfile(TypeAnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter, SignatureReader signatureReader) -
getReaderForAnnotationAtMethodInfo
public static TypeAnnotationsReader getReaderForAnnotationAtMethodInfo(TypeAnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter, ExceptionsReader exceptionReader, SignatureReader signatureReader) -
getReaderForAnnotationAtFieldInfo
public static TypeAnnotationsReader getReaderForAnnotationAtFieldInfo(TypeAnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter) -
getReaderForAnnotationAtCode
public static TypeAnnotationsReader getReaderForAnnotationAtCode(TypeAnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter, CodeReader codereader)
-