Interface SerializerFactory

  • All Known Implementing Classes:
    SerializerFactoryImpl

    public interface SerializerFactory
    A factory that returns a Serializer for any given TypeMirror.

    Defaults to an identity serializer if no SerializerExtensions are suitable.

    • Method Detail

      • 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.