public class AnnotationsReader extends AttributeReader
| Modifier and Type | Class and Description |
|---|---|
static class |
AnnotationsReader.AnnotationAttribute
Representation of an annotation attribute.
|
static class |
AnnotationsReader.AnnotationType |
static class |
AnnotationsReader.ArrayElementValue
represents an annotation argument that itself is an array of arguments
|
static class |
AnnotationsReader.ConstantElementValue
Represents a constant argument to an annotation.
|
static interface |
AnnotationsReader.ElementValue
Marker interface for possible element values in an annotation attribute.
|
static class |
AnnotationsReader.EnumElementValue
Represents enum constant annotation arguments.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
beginOffset
offset in class file where this attribute begins
|
attr, cr, length| Constructor and Description |
|---|
AnnotationsReader(ClassReader.AttrIterator iter,
String label) |
| Modifier and Type | Method and 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];
|
int |
getAnnotationCount() |
protected com.ibm.wala.util.collections.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]
|
int |
getAttributeSize() |
static AnnotationsReader |
getReaderForAnnotation(AnnotationsReader.AnnotationType type,
ClassReader.AttrIterator iter) |
protected String |
getUtf8ConstantPoolValue(int offset)
get the Utf8 constant pool value, where the constant pool offset is given
in the class
|
static boolean |
isKnownAnnotation(String name) |
protected com.ibm.wala.util.collections.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;
|
checkSize, checkSizeEquals, getClassReader, getRawOffset, getRawSizeprotected final int beginOffset
public AnnotationsReader(ClassReader.AttrIterator iter, String label) throws InvalidClassFileException
InvalidClassFileExceptionpublic int getAnnotationCount()
throws InvalidClassFileException
InvalidClassFileExceptionpublic int getAttributeSize()
throws InvalidClassFileException
InvalidClassFileExceptionprotected String getUtf8ConstantPoolValue(int offset) throws InvalidClassFileException
offset - offset in the class file at which the constant pool offset is
givenInvalidClassFileExceptionpublic AnnotationsReader.AnnotationAttribute[] getAllAnnotations() throws InvalidClassFileException
RuntimeVisibleAnnotations_attribute {
u2 attribute_name_index;
u4 attribute_length;
u2 num_annotations;
annotation annotations[num_annotations];
}
InvalidClassFileExceptionpublic 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];
InvalidClassFileExceptionprotected com.ibm.wala.util.collections.Pair<AnnotationsReader.AnnotationAttribute,Integer> getAttributeAndSize(int begin) throws InvalidClassFileException
annotation {
u2 type_index;
u2 num_element_value_pairs;
{ u2 element_name_index;
element_value value;
} element_value_pairs[num_element_value_pairs]
InvalidClassFileExceptionprotected com.ibm.wala.util.collections.Pair<AnnotationsReader.ElementValue,Integer> readElementValueAndSize(int offset) throws IllegalArgumentException, InvalidClassFileException
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;
A constant value (including class info) is represented by a
AnnotationsReader.ConstantElementValue. An enum constant value is represented by an
AnnotationsReader.EnumElementValue. An array value is represented by an
AnnotationsReader.ArrayElementValue. Finally, a nested annotation is represented by
an AnnotationsReader.AnnotationAttribute.public static boolean isKnownAnnotation(String name)
public static AnnotationsReader getReaderForAnnotation(AnnotationsReader.AnnotationType type, ClassReader.AttrIterator iter)
Copyright © 2019. All rights reserved.