Interface SymbolicValue.SymAnnot

    • Method Detail

      • getAttribute

        @Nullable SymbolicValue getAttribute​(String attrName)
        Returns the value of the attribute, which may fall back to the default value of the annotation element. Returns null if the attribute does not exist, is unresolved, or has no default. TODO do we need separate sentinels for that?
      • getAnnotationSymbol

        @NonNull JClassSymbol getAnnotationSymbol()
        Return the symbol for the declaring class of the annotation.
      • getAttributeNames

        default org.pcollections.PSet<String> getAttributeNames()
        Return the simple names of all attributes, including those defined in the annotation type but not explicitly set in this annotation. Note that if the annotation is reflected from a class file, we can't know which annotations used their default value, so it returns a set of all attribute names.
      • getBinaryName

        default String getBinaryName()
        Return the binary name of the annotation type.
      • getSimpleName

        default String getSimpleName()
        Return the simple name of the annotation type.
      • valueEquals

        default boolean valueEquals​(Object o)
        Description copied from interface: SymbolicValue
        Returns true if this symbolic value represents the same value as the given object. If the parameter is null, returns false.
        Specified by:
        valueEquals in interface SymbolicValue
      • getRetention

        default RetentionPolicy getRetention()
        The retention policy. Note that naturally, members accessed from class files cannot reflect annotations with RetentionPolicy.SOURCE.
      • isOfType

        default boolean isOfType​(String binaryName)
        Return true if this annotation's binary name matches the given binary name.
      • isOfType

        default boolean isOfType​(Class<? extends Annotation> klass)
        Whether the annotation has the given type. Note that only the name of the class is taken into account, because its Class instance may be missing from the type system classpath.
      • attributeMatches

        default OptionalBool attributeMatches​(String attrName,
                                              Object attrValue)
        Returns YES if the annotation has the attribute set to the given value. Returns NO if it is set to another value. Returns UNKNOWN if the attribute does not exist or is unresolved.
      • attributeContains

        default OptionalBool attributeContains​(String attrName,
                                               Object attrValue)
        Returns YES if the annotation has the attribute set to the given value, or to an array containing the given value. Returns NO if that's not the case. Returns UNKNOWN if the attribute does not exist or is unresolved.