private MethodSpec buildNewDeserializerMethod ( JClassType mappedTypeClass ) throws UnableToCompleteException { JDeserializerType type ; try { type = getJsonDeserializerFromType ( mappedTypeClass ) ; } catch ( UnsupportedTypeException e ) { logger . log ( Type . ERROR , "Cannot generate mapper due to previous errors : " + e . getMessage ( ) ) ; throw new UnableToCompleteException ( ) ; } return MethodSpec . methodBuilder ( "newDeserializer" ) . addModifiers ( Modifier . PROTECTED ) . addAnnotation ( Override . class ) . returns ( parameterizedName ( JsonDeserializer . class , mappedTypeClass ) ) . addStatement ( "return $L" , type . getInstance ( ) ) . build ( ) ; }
Build the new deserializer method .