Interface SerializerFactory
-
- All Known Implementing Classes:
SerializerFactoryImpl
public interface SerializerFactory
A factory that returns aSerializer
for any givenTypeMirror
.Defaults to an identity serializer if no SerializerExtensions are suitable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Serializer
getSerializer(TypeMirror type)
Returns aSerializer
for the givenTypeMirror
.default com.squareup.javapoet.CodeBlock
newIdentifier(String prefix)
Returns an identifier beginning with the given prefix and that is distinct from any identifier returned by another call to this method.
-
-
-
Method Detail
-
getSerializer
Serializer getSerializer(TypeMirror type)
Returns aSerializer
for the givenTypeMirror
.
-
newIdentifier
default com.squareup.javapoet.CodeBlock newIdentifier(String prefix)
Returns an identifier beginning with the given prefix and that is distinct from any identifier returned by another call to this method. The returned identifier will contain a$
, which should also mean it is distinct from identifiers in user code that are in scope.The default implementation of this method throws
UnsupportedOperationException
for compatibility reasons.
-
-