CodeQL library for Java/Kotlin
codeql/java-all 0.9.0 (changelog, source)
Search

Member predicate AnnotationType::isATargetType

Holds if the element type is a possible target for this annotation type. The elementType is the name of one of the java.lang.annotation.ElementType enum constants.

If this annotation type has no @Target annotation, it is considered to be applicable in all declaration contexts. This matches the behavior of the latest Java versions but differs from the behavior of older Java versions. This predicate must only be called with names of ElementType enum constants; for other values it might hold erroneously.

predicate isATargetType(string elementType)