Class AnnotationParameterValueList

All Implemented Interfaces:
Serializable, Cloneable, Iterable<AnnotationParameterValue>, Collection<AnnotationParameterValue>, List<AnnotationParameterValue>, RandomAccess, SequencedCollection<AnnotationParameterValue>

public class AnnotationParameterValueList extends MappableInfoList<AnnotationParameterValue>
A list of AnnotationParameterValue objects.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • emptyList

      public static AnnotationParameterValueList emptyList()
      Return an unmodifiable empty AnnotationParameterValueList.
      Returns:
      the unmodifiable empty AnnotationParameterValueList.
    • findReferencedClassInfo

      protected void findReferencedClassInfo(Map<String,ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log)
      Get ClassInfo objects for any classes referenced in the methods in this list.
      Parameters:
      classNameToClassInfo - the map from class name to ClassInfo.
      refdClassInfo - the referenced class info
      log - the log
    • convertWrapperArraysToPrimitiveArrays

      void convertWrapperArraysToPrimitiveArrays(ClassInfo annotationClassInfo)
      For primitive array type params, replace Object[] arrays containing boxed types with primitive arrays (need to check the type of each method of the annotation class to determine if it is a primitive array type).
      Parameters:
      annotationClassInfo - the annotation class info
    • getValue

      public Object getValue(String parameterName)
      Get the annotation parameter value, by calling AnnotationParameterValue.getValue() on the result of MappableInfoList.get(String), if non-null.
      Parameters:
      parameterName - The name of an annotation parameter.
      Returns:
      The value of the AnnotationParameterValue object in the list with the given name, by calling AnnotationParameterValue.getValue() on that object, or null if not found.

      The annotation parameter value may be one of the following types:

      • String for string constants
      • String[] for arrays of strings
      • A boxed type, e.g. Integer or Character, for primitive-typed constants
      • A 1-dimensional primitive-typed array (i.e. int[], long[], short[], char[], byte[], boolean[], float[], or double[]), for arrays of primitives
      • A 1-dimensional Object[] array for array types (and then the array element type may be one of the types in this list)
      • AnnotationEnumValue, for enum constants (this wraps the enum class and the string name of the constant)
      • AnnotationClassRef, for Class references within annotations (this wraps the name of the referenced class)
      • AnnotationInfo, for nested annotations