Package com.ibm.wala.shrikeCT
Class AnnotationsReader
- java.lang.Object
-
- com.ibm.wala.shrikeCT.AttributeReader
-
- com.ibm.wala.shrikeCT.AnnotationsReader
-
public class AnnotationsReader extends AttributeReader
This class reads Annotations attributes, e.g., RuntimeInvisibleAnnotations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnnotationsReader.AnnotationAttributeRepresentation of an annotation attribute.static classAnnotationsReader.AnnotationTypestatic classAnnotationsReader.ArrayElementValuerepresents an annotation argument that itself is an array of argumentsstatic classAnnotationsReader.ConstantElementValueRepresents a constant argument to an annotation.static interfaceAnnotationsReader.ElementValueMarker interface for possible element values in an annotation attribute.static classAnnotationsReader.EnumElementValueRepresents enum constant annotation arguments.
-
Field Summary
-
Fields inherited from class com.ibm.wala.shrikeCT.AttributeReader
attr, cr, length
-
-
Constructor Summary
Constructors Constructor Description AnnotationsReader(ClassReader.AttrIterator iter, String label)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationsReader.AnnotationAttribute[]getAllAnnotations()get all the annotations declared in this attribute.AnnotationsReader.AnnotationAttribute[][]getAllParameterAnnotations()param_annotations { u2 attribute_name_index; u4 attribute_length; u1 num_parameters; { u2 num_annotations; annotation annotations[num_annotations]; } parameter_annotations[num_parameters];intgetAnnotationCount()intgetAttributeSize()static AnnotationsReadergetReaderForAnnotation(AnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter)static booleanisKnownAnnotation(String name)-
Methods inherited from class com.ibm.wala.shrikeCT.AttributeReader
checkSize, checkSizeEquals, getClassReader, getRawOffset, getRawSize
-
-
-
-
Constructor Detail
-
AnnotationsReader
public AnnotationsReader(ClassReader.AttrIterator iter, String label) throws InvalidClassFileException
- Throws:
InvalidClassFileException
-
-
Method Detail
-
getAnnotationCount
public int getAnnotationCount() throws InvalidClassFileException- Returns:
- number of annotations in this attribute
- Throws:
InvalidClassFileException
-
getAttributeSize
public int getAttributeSize() throws InvalidClassFileException- Returns:
- total length of this attribute in bytes,
including the first 6 bytes - Throws:
InvalidClassFileException
-
getAllAnnotations
public AnnotationsReader.AnnotationAttribute[] getAllAnnotations() throws InvalidClassFileException
get all the annotations declared in this attribute.- Throws:
InvalidClassFileException
-
getAllParameterAnnotations
public AnnotationsReader.AnnotationAttribute[][] getAllParameterAnnotations() throws InvalidClassFileException
param_annotations { u2 attribute_name_index; u4 attribute_length; u1 num_parameters; { u2 num_annotations; annotation annotations[num_annotations]; } parameter_annotations[num_parameters];- Throws:
InvalidClassFileException
-
isKnownAnnotation
public static boolean isKnownAnnotation(String name)
-
getReaderForAnnotation
public static AnnotationsReader getReaderForAnnotation(AnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter)
-
-