Retrofit源码分析

OkHttpCall
	ServiceMethod serviceMethod = serviceMethod;
    Object[] args = args;
	
ExecutorCallbackCall<T> implements Call<T>
	Executor callbackExecutor;
    Call<T> delegate;


	
ParameterHandler
RelativeUrl


ServiceMethod
	this.retrofit = retrofit;
	this.method = method;
	this.methodAnnotations = method.getAnnotations();
	this.parameterTypes = method.getGenericParameterTypes();
	this.parameterAnnotationsArray = method.getParameterAnnotations();
	
	CallAdapter<?> callAdapter = createCallAdapter();
	responseType = callAdapter.responseType();
	responseConverter = createResponseConverter()
	
	this.httpMethod = httpMethod;
    this.hasBody = hasBody;
	this.relativeUrl = value;
    this.relativeUrlParamNames = parsePathParameters(value);


CallAdapter
	Type responseType();
	<R> T adapt(Call<R> call)
Retrofit
	boolean validateEagerly=false
	HttpUrl baseUrl
	Platform platform=Platform.get()
	
	List<Converter.Factory> converterFactories 
		BuiltInConverters
		GsonConverterFactory.create()
		ScalarsConverterFactory.create()
	List<CallAdapter.Factory> adapterFactories
		ExecutorCallAdapterFactory(MainThreadExecutor)
			
	okhttp3.Call.Factory callFactory=OkHttpClient
	Executor callbackExecutor=MainThreadExecutor
ExecutorCallAdapterFactory
	Executor callbackExecutor
	
Android
	Executor MainThreadExecutor
	CallAdapter.Factory

猜你喜欢

转载自blog.csdn.net/u014763302/article/details/62044875