Package com.google.auto.common
Class GeneratedAnnotationSpecs
- java.lang.Object
-
- com.google.auto.common.GeneratedAnnotationSpecs
-
public final class GeneratedAnnotationSpecs extends Object
Utility methods for writing@Generated
annotations using JavaPoet.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Optional<com.squareup.javapoet.AnnotationSpec>
generatedAnnotationSpec(Elements elements, Class<?> processorClass)
Deprecated.static Optional<com.squareup.javapoet.AnnotationSpec>
generatedAnnotationSpec(Elements elements, Class<?> processorClass, String comments)
Deprecated.static Optional<com.squareup.javapoet.AnnotationSpec>
generatedAnnotationSpec(Elements elements, SourceVersion sourceVersion, Class<?> processorClass)
Returns@Generated("processorClass")
for the targetSourceVersion
.static Optional<com.squareup.javapoet.AnnotationSpec>
generatedAnnotationSpec(Elements elements, SourceVersion sourceVersion, Class<?> processorClass, String comments)
Returns@Generated(value = "processorClass", comments = "comments")
for the targetSourceVersion
.
-
-
-
Method Detail
-
generatedAnnotationSpec
@Deprecated public static Optional<com.squareup.javapoet.AnnotationSpec> generatedAnnotationSpec(Elements elements, Class<?> processorClass)
Deprecated.Returns@Generated("processorClass")
if eitherjavax.annotation.processing.Generated
orjavax.annotation.Generated
is available at compile time.
-
generatedAnnotationSpec
@Deprecated public static Optional<com.squareup.javapoet.AnnotationSpec> generatedAnnotationSpec(Elements elements, Class<?> processorClass, String comments)
Deprecated.Returns@Generated(value = "processorClass", comments = "comments")
if eitherjavax.annotation.processing.Generated
orjavax.annotation.Generated
is available at compile time.
-
generatedAnnotationSpec
public static Optional<com.squareup.javapoet.AnnotationSpec> generatedAnnotationSpec(Elements elements, SourceVersion sourceVersion, Class<?> processorClass)
Returns@Generated("processorClass")
for the targetSourceVersion
.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.
-
generatedAnnotationSpec
public static Optional<com.squareup.javapoet.AnnotationSpec> generatedAnnotationSpec(Elements elements, SourceVersion sourceVersion, Class<?> processorClass, String comments)
Returns@Generated(value = "processorClass", comments = "comments")
for the targetSourceVersion
.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.
-
-