Package com.google.auto.value.processor
Class GwtSerialization
- java.lang.Object
-
- com.google.auto.value.processor.GwtSerialization
-
class GwtSerialization extends java.lang.Object
Generates GWT serialization code for@AutoValue
classes also marked@GwtCompatible(serializable = true)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
GwtSerialization.GwtTemplateVars
static class
GwtSerialization.Property
-
Field Summary
Fields Modifier and Type Field Description private GwtCompatibility
gwtCompatibility
private javax.annotation.processing.ProcessingEnvironment
processingEnv
private javax.lang.model.element.TypeElement
type
-
Constructor Summary
Constructors Constructor Description GwtSerialization(GwtCompatibility gwtCompatibility, javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.element.TypeElement type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
computeClassHash(java.lang.Iterable<AutoValueOrOneOfProcessor.Property> props, java.lang.String pkg)
(package private) void
maybeWriteGwtSerializer(AutoValueTemplateVars autoVars)
Writes the GWT serializer for the given type, if appropriate.private boolean
shouldWriteGwtSerializer()
private void
writeSourceFile(java.lang.String className, java.lang.String text, javax.lang.model.element.TypeElement originatingType)
-
-
-
Field Detail
-
gwtCompatibility
private final GwtCompatibility gwtCompatibility
-
processingEnv
private final javax.annotation.processing.ProcessingEnvironment processingEnv
-
type
private final javax.lang.model.element.TypeElement type
-
-
Constructor Detail
-
GwtSerialization
GwtSerialization(GwtCompatibility gwtCompatibility, javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.element.TypeElement type)
-
-
Method Detail
-
shouldWriteGwtSerializer
private boolean shouldWriteGwtSerializer()
-
maybeWriteGwtSerializer
void maybeWriteGwtSerializer(AutoValueTemplateVars autoVars)
Writes the GWT serializer for the given type, if appropriate. An@AutoValue
class gets a GWT serializer if it is annotated with@GwtCompatible(serializable = true)
, where the@GwtCompatible
annotation can come from any package.If the type is com.example.Foo then the generated AutoValue subclass is com.example.AutoValue_Foo and the GWT serializer is com.example.AutoValue_Foo_CustomFieldSerializer.
- Parameters:
autoVars
- the template variables defined for this type.
-
writeSourceFile
private void writeSourceFile(java.lang.String className, java.lang.String text, javax.lang.model.element.TypeElement originatingType)
-
computeClassHash
private java.lang.String computeClassHash(java.lang.Iterable<AutoValueOrOneOfProcessor.Property> props, java.lang.String pkg)
-
-