Package com.google.auto.value.processor
Class GwtSerialization
- java.lang.Object
-
- com.google.auto.value.processor.GwtSerialization
-
class GwtSerialization extends java.lang.ObjectGenerates GWT serialization code for@AutoValueclasses also marked@GwtCompatible(serializable = true).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classGwtSerialization.GwtTemplateVarsstatic classGwtSerialization.Property
-
Field Summary
Fields Modifier and Type Field Description private GwtCompatibilitygwtCompatibilityprivate javax.annotation.processing.ProcessingEnvironmentprocessingEnvprivate javax.lang.model.element.TypeElementtype
-
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.StringcomputeClassHash(java.lang.Iterable<AutoValueOrOneOfProcessor.Property> props, java.lang.String pkg)(package private) voidmaybeWriteGwtSerializer(AutoValueTemplateVars autoVars)Writes the GWT serializer for the given type, if appropriate.private booleanshouldWriteGwtSerializer()private voidwriteSourceFile(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@AutoValueclass gets a GWT serializer if it is annotated with@GwtCompatible(serializable = true), where the@GwtCompatibleannotation 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)
-
-