code: private MethodSpec buildNewSerializerMethod( JClassType mappedTypeClass ) throws UnableToCompleteException {
          JSerializerType type;
          try {
              type = getJsonSerializerFromType( mappedTypeClass );
          } catch ( UnsupportedTypeException e ) {
              logger.log( Type.ERROR, "Cannot generate mapper due to previous errors : " + e.getMessage() );
              throw new UnableToCompleteException();
          }
  
          return MethodSpec.methodBuilder( "newSerializer" )
                  .addModifiers( Modifier.PROTECTED )
                  .addAnnotation( Override.class )
                  .returns( ParameterizedTypeName.get( ClassName.get( JsonSerializer.class ), DEFAULT_WILDCARD ) )
                  .addStatement( "return $L", type.getInstance() )
                  .build();
      }
docs: Build the new serializer method.
  
  @param mappedTypeClass the type to map
  
  @return the method