Package com.ibm.wala.types.annotations
Class Annotation
- java.lang.Object
-
- com.ibm.wala.types.annotations.Annotation
-
public class Annotation extends Object
Represents a member annotation, e.g., Java 5.0 class file annotations
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static Collection<Annotation>
convertToAnnotations(ClassLoaderReference clRef, AnnotationsReader.AnnotationAttribute[] allAnnotations)
boolean
equals(Object obj)
static Collection<Annotation>
getAnnotationsFromReader(AnnotationsReader r, ClassLoaderReference clRef)
Map<String,AnnotationsReader.ElementValue>
getNamedArguments()
Get the named arguments to the annotation, represented as a mapping from name to valuestatic Collection<Annotation>[]
getParameterAnnotationsFromReader(AnnotationsReader r, ClassLoaderReference clRef)
If r != null, return parameter annotations as an array with length equal to number of annotatable parameters.TypeReference
getType()
Get the type of the annotationPair<TypeReference,Object>[]
getUnnamedArguments()
Get the unnamed arguments to the annotation (e.g., constructor arguments for C# attributes), represented as an array of pairs (T,V), where T is the argument type and V is the value.int
hashCode()
static Annotation
make(TypeReference t)
static Annotation
makeUnnamedAndNamed(TypeReference t, Map<String,AnnotationsReader.ElementValue> namedArguments, Pair<TypeReference,Object>[] unnamedArguments)
static Annotation
makeWithNamed(TypeReference t, Map<String,AnnotationsReader.ElementValue> namedArguments)
static Annotation
makeWithUnnamed(TypeReference t, Pair<TypeReference,Object>[] unnamedArguments)
String
toString()
-
-
-
Method Detail
-
makeUnnamedAndNamed
public static Annotation makeUnnamedAndNamed(TypeReference t, Map<String,AnnotationsReader.ElementValue> namedArguments, Pair<TypeReference,Object>[] unnamedArguments)
-
makeWithUnnamed
public static Annotation makeWithUnnamed(TypeReference t, Pair<TypeReference,Object>[] unnamedArguments)
-
make
public static Annotation make(TypeReference t)
-
makeWithNamed
public static Annotation makeWithNamed(TypeReference t, Map<String,AnnotationsReader.ElementValue> namedArguments)
-
getAnnotationsFromReader
public static Collection<Annotation> getAnnotationsFromReader(AnnotationsReader r, ClassLoaderReference clRef) throws InvalidClassFileException
- Throws:
InvalidClassFileException
-
getParameterAnnotationsFromReader
public static Collection<Annotation>[] getParameterAnnotationsFromReader(AnnotationsReader r, ClassLoaderReference clRef) throws InvalidClassFileException
If r != null, return parameter annotations as an array with length equal to number of annotatable parameters. Otherwise, return null.- Throws:
InvalidClassFileException
-
convertToAnnotations
protected static Collection<Annotation> convertToAnnotations(ClassLoaderReference clRef, AnnotationsReader.AnnotationAttribute[] allAnnotations)
-
getUnnamedArguments
public Pair<TypeReference,Object>[] getUnnamedArguments()
Get the unnamed arguments to the annotation (e.g., constructor arguments for C# attributes), represented as an array of pairs (T,V), where T is the argument type and V is the value. The array preserves the order in which the arguments were passed. If null, there are no unnamed arguments.
-
getNamedArguments
public Map<String,AnnotationsReader.ElementValue> getNamedArguments()
Get the named arguments to the annotation, represented as a mapping from name to value
-
getType
public TypeReference getType()
Get the type of the annotation
-
-