public final class AutoValueUtil
extends java.lang.Object
AutoValueExtension.| Modifier and Type | Method and Description |
|---|---|
static void |
error(com.google.auto.value.extension.AutoValueExtension.Context context,
Property property,
java.lang.String message)
Will call
Messager.printMessage(Diagnostic.Kind, CharSequence, Element) with
Diagnostic.Kind#ERROR and the given message for property. |
static void |
error(com.google.auto.value.extension.AutoValueExtension.Context context,
Property property,
java.lang.String message,
java.lang.Object... args)
Will call
Messager.printMessage(Diagnostic.Kind, CharSequence, Element) with
Diagnostic.Kind#ERROR and the given message formatted using args for
property. |
static com.squareup.javapoet.ClassName |
getAutoValueClassClassName(com.google.auto.value.extension.AutoValueExtension.Context context)
Returns the
ClassName of the class annotated with AutoValue. |
static com.squareup.javapoet.ClassName |
getFinalClassClassName(com.google.auto.value.extension.AutoValueExtension.Context context)
Returns the
ClassName of the last class in the chain of generated implementations,
which is final. |
static com.squareup.javapoet.CodeBlock |
newFinalClassConstructorCall(com.google.auto.value.extension.AutoValueExtension.Context context,
java.lang.Object[] properties)
Creates a
CodeBlock that calls the constructor of the final generated class
AutoValueUtil#getFinalClassClassName(Context). |
static com.squareup.javapoet.TypeSpec.Builder |
newTypeSpecBuilder(com.google.auto.value.extension.AutoValueExtension.Context context,
java.lang.String className,
java.lang.String classToExtend,
boolean isFinal)
Creates a new
TypeSpec.Builder for the class that is generated by the extension. |
public static com.squareup.javapoet.ClassName getAutoValueClassClassName(com.google.auto.value.extension.AutoValueExtension.Context context)
ClassName of the class annotated with AutoValue.public static com.squareup.javapoet.ClassName getFinalClassClassName(com.google.auto.value.extension.AutoValueExtension.Context context)
ClassName of the last class in the chain of generated implementations,
which is final. This can be used for creating new instances.public static com.squareup.javapoet.TypeSpec.Builder newTypeSpecBuilder(com.google.auto.value.extension.AutoValueExtension.Context context,
java.lang.String className,
java.lang.String classToExtend,
boolean isFinal)
TypeSpec.Builder for the class that is generated by the extension. It
will add a final or abstract modifier, the superclass and a constructor that calls super. The
returned TypeSpec will also include all TypeVariables if the AutoValue class is generic.public static com.squareup.javapoet.CodeBlock newFinalClassConstructorCall(com.google.auto.value.extension.AutoValueExtension.Context context,
java.lang.Object[] properties)
CodeBlock that calls the constructor of the final generated class
AutoValueUtil#getFinalClassClassName(Context). The given properties array
should either contain plain String's or JavaPoet Names.public static void error(com.google.auto.value.extension.AutoValueExtension.Context context,
Property property,
java.lang.String message)
Messager.printMessage(Diagnostic.Kind, CharSequence, Element) with
Diagnostic.Kind#ERROR and the given message for property. This will
ultimately fail the build, but will not abort it right now.public static void error(com.google.auto.value.extension.AutoValueExtension.Context context,
Property property,
java.lang.String message,
java.lang.Object... args)
Messager.printMessage(Diagnostic.Kind, CharSequence, Element) with
Diagnostic.Kind#ERROR and the given message formatted using args for
property. This will ultimately fail the build, but will not abort it right now.