Class Annotation
java.lang.Object
com.ibm.wala.types.annotations.Annotation
Represents a member annotation, e.g., Java 5.0 class file annotations
-
Method Summary
Modifier and TypeMethodDescriptionprotected static Collection<Annotation> convertToAnnotations(ClassLoaderReference clRef, AnnotationsReader.AnnotationAttribute[] allAnnotations) booleanstatic Collection<Annotation> Get the named arguments to the annotation, represented as a mapping from name to valuestatic Collection<Annotation>[]If r != null, return parameter annotations as an array with length equal to number of annotatable parameters.getType()Get the type of the annotationPair<TypeReference, Object>[]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.inthashCode()static Annotationstatic AnnotationmakeUnnamedAndNamed(TypeReference t, Map<String, AnnotationsReader.ElementValue> namedArguments, Pair<TypeReference, Object>[] unnamedArguments) static AnnotationmakeWithNamed(TypeReference t, Map<String, AnnotationsReader.ElementValue> namedArguments) static AnnotationmakeWithUnnamed(TypeReference t, Pair<TypeReference, Object>[] unnamedArguments) toString()
-
Method Details
-
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
-
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) -
toString
-
hashCode
-
equals
-
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
Get the named arguments to the annotation, represented as a mapping from name to value -
getType
Get the type of the annotation
-