public final class GeneratedAnnotations extends Object
@Generated
annotations.Modifier and Type | Method and Description |
---|---|
static Optional<TypeElement> |
generatedAnnotation(Elements elements)
Deprecated.
|
static Optional<TypeElement> |
generatedAnnotation(Elements elements,
SourceVersion sourceVersion)
Returns the element corresponding to the
@Generated annotation present at the target
SourceVersion . |
@Deprecated public static Optional<TypeElement> generatedAnnotation(Elements elements)
generatedAnnotation(Elements, SourceVersion)
@Generated
annotation present
in the compile-time class- or module-path.
First looks for javax.annotation.processing.Generated
, and then javax.annotation.Generated
. Returns whichever is in the classpath (or modulepath), or Optional.empty()
if neither is.
public static Optional<TypeElement> generatedAnnotation(Elements elements, SourceVersion sourceVersion)
@Generated
annotation present at the target
SourceVersion
.
Returns javax.annotation.processing.Generated
for JDK 9 and newer, javax.annotation.Generated
for earlier releases, and Optional#empty()} if the annotation is
not available.
Copyright © 2020. All rights reserved.