Extensions are discovered at compile time using the java. APIs,
allowing them to run without any additional annotations. To be found by ServiceLoader, an
extension class must be public with a public no-arg constructor, and its fully-qualified name
must appear in a file called META-INF/services/com.google.auto.value.extension.serializable.serializer.interfaces.SerializerExtension
in a jar that is on the compiler's -classpath or -processorpath.
When SerializableAutoValue maps each field in an AutoValue to a serializable proxy object, it
asks each SerializerExtension whether it can generate code to make the given type serializable. A
SerializerExtension replies that it can by returning a non-empty Serializer.
A SerializerExtension is also provided with a SerializerFactory, which it can use to query nested types.
| Modifier and Type | Method and Description |
|---|---|
| public Optional | getSerializer(javax.
the type being serialized type,a factory, javax.SerializerFactory that can be used to serialize nested typesthe processing environment provided by the annotation processing framework processingEnvReturns a |
| getSerializer | back to summary |
|---|---|
| public Optional Returns a
| |