Package com.google.auto.common
Class GeneratedAnnotations
- java.lang.Object
-
- com.google.auto.common.GeneratedAnnotations
-
public final class GeneratedAnnotations extends java.lang.ObjectUtility methods for writing@Generatedannotations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.Optional<javax.lang.model.element.TypeElement>generatedAnnotation(javax.lang.model.util.Elements elements)Deprecated.static java.util.Optional<javax.lang.model.element.TypeElement>generatedAnnotation(javax.lang.model.util.Elements elements, javax.lang.model.SourceVersion sourceVersion)Returns the element corresponding to the@Generatedannotation present at the targetSourceVersion.
-
-
-
Method Detail
-
generatedAnnotation
@Deprecated public static java.util.Optional<javax.lang.model.element.TypeElement> generatedAnnotation(javax.lang.model.util.Elements elements)
Deprecated.Returns the element corresponding to the version of the@Generatedannotation present in the compile-time class- or module-path.First looks for
javax.annotation.processing.Generated, and thenjavax.annotation.Generated. Returns whichever is in the classpath (or modulepath), orOptional.empty()if neither is.
-
generatedAnnotation
public static java.util.Optional<javax.lang.model.element.TypeElement> generatedAnnotation(javax.lang.model.util.Elements elements, javax.lang.model.SourceVersion sourceVersion)Returns the element corresponding to the@Generatedannotation present at the targetSourceVersion.Returns
javax.annotation.processing.Generatedfor JDK 9 and newer,javax.annotation.Generatedfor earlier releases, and Optional#empty()} if the annotation is not available.
-
-