本文整理汇总了Java中retrofit.converter.SimpleXMLConverter类的典型用法代码示例。如果您正苦于以下问题:Java SimpleXMLConverter类的具体用法?Java SimpleXMLConverter怎么用?Java SimpleXMLConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimpleXMLConverter类属于retrofit.converter包,在下文中一共展示了SimpleXMLConverter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
public static void main(String[] args) {
RestAdapter restAdapter = new RestAdapter.Builder()
.setServer("http://gdata.youtube.com")
.setConverter(new SimpleXMLConverter())
.build();
restAdapter.setLogLevel(LogLevel.FULL);
YouTubeDataService service = restAdapter
.create(YouTubeDataService.class);
if (args == null || args.length < 1) {
usage();
return;
}
String query = args[0];
Feed result = service.search(query, "published", 1);
System.out.printf("検索キーワード:%s\n", query);
System.out.printf("%s件中%s件〜%s件目を表示\n", result.totalResults,
result.startIndex,
(result.startIndex + result.itemsPerPage - 1));
int i = 1;
for (Entry entry : result.entries) {
System.out.printf("%d: %s: %s\n", i, entry.title, entry.getHtmlLocation());
i++;
}
}
示例2: CatService
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
private CatService() {
mAsyncRestAdapter = new RestAdapter.Builder()
.setEndpoint(API_URL)
.setConverter(new SimpleXMLConverter())
.setLogLevel(RestAdapter.LogLevel.FULL)
.build();
}
示例3: newRssService
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
private RssService newRssService() {
final RestAdapter restAdapter = new RestAdapter.Builder()
.setClient(new OkClient())
.setEndpoint(this.mEndpoint)
.setConverter(new SimpleXMLConverter())
.build();
return restAdapter.create(RssService.class);
}
示例4: createService
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
public static <S> S createService(Class<S> serviceClass, String baseUrl, final OAuthParameters oAuthParams) {
OkHttpClient client = new OkHttpClient();
client.networkInterceptors().add(new OAuthInterceptor(oAuthParams));
builder.setClient(new OkClient(client));
builder.setEndpoint(baseUrl).setLogLevel(RestAdapter.LogLevel.FULL);
builder.setConverter(new SimpleXMLConverter());
RestAdapter adapter = builder.build();
return adapter.create(serviceClass);
}
示例5: provideRestAdapter
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
@Provides
public RestAdapter provideRestAdapter() {
return new RestAdapter.Builder()
.setEndpoint("http://binamcast.ir")
.setConverter(new SimpleXMLConverter())
.setLogLevel(RestAdapter.LogLevel.BASIC)
.build();
}
示例6: getService
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
private static TVDBService getService() {
if (service == null) {
RestAdapter restAdapter = new RestAdapter.Builder()
.setConverter(new SimpleXMLConverter())
.setEndpoint(ApiConstants.TVDB_SERVER_URL)
.setLogLevel(RestAdapter.LogLevel.FULL)
.build();
service = restAdapter.create(TVDBService.class);
}
return service;
}
示例7: getEndPoint
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
public FDroidEndPoint getEndPoint() {
return new RestAdapter.Builder()
.setConverter(new SimpleXMLConverter())
.setErrorHandler(new FDroidErrorHandler())
.setEndpoint(appMarketHost)
.setClient(new ApacheClient())
.setLogLevel(RestAdapter.LogLevel.FULL)
.build().create(FDroidEndPoint.class);
}
示例8: TalkClient
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
private TalkClient() {
restAdapter = new RestAdapter.Builder()
.setEndpoint(ApiConfig.BASE_URL)
.setClient(new OkClient())
.setRequestInterceptor(requestInterceptor)
.setConverter(new GsonConverter(gson))
.setErrorHandler(authFailedErrorHandler)
.setLogLevel(REST_LOG_LEVEL)
.build();
uploadAdapter = new RestAdapter.Builder()
.setEndpoint(ApiConfig.UPLOAD_URL)
.setClient(new OkClient())
.setRequestInterceptor(strikerInterceptor)
.setLogLevel(REST_LOG_LEVEL)
.build();
accountAdapter = new RestAdapter.Builder()
.setEndpoint(ApiConfig.ACCOUNT_URL)
.setClient(new OkClient())
.setRequestInterceptor(requestInterceptor)
.setLogLevel(REST_LOG_LEVEL)
.build();
callAdapter = new RestAdapter.Builder()
.setClient(new OkClient())
.setEndpoint(ApiConfig.CALL_URL)
.setConverter(new SimpleXMLConverter(new Persister(new AnnotationStrategy())))
.setRequestInterceptor(callInterceptor)
.setLogLevel(REST_LOG_LEVEL)
.build();
spiderAdapter = new RestAdapter.Builder()
.setEndpoint(ApiConfig.SPIDER_URL)
.setClient(new OkClient())
.setRequestInterceptor(requestInterceptor)
.setConverter(new GsonConverter(gson))
.build();
tpsAdapter = new RestAdapter.Builder()
.setClient(new OkClient())
.setEndpoint(ApiConfig.TPS_API)
.setRequestInterceptor(requestInterceptor)
.setLogLevel(REST_LOG_LEVEL)
.build();
tbAuthAdapter = new RestAdapter.Builder()
.setEndpoint(ApiConfig.AUTH_SERVICE_URL)
.setClient(new OkClient())
.setRequestInterceptor(requestInterceptor)
.setConverter(new GsonConverter(gson))
.setLogLevel(REST_LOG_LEVEL)
.build();
deviceId = DeviceUtil.getDeviceId(MainApp.CONTEXT);
}
示例9: provideConverter
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
@Provides
@Singleton
Converter provideConverter()
{
return new SimpleXMLConverter();
}
示例10: getFlickrApiConverter
import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
private Converter getFlickrApiConverter() {
return new SimpleXMLConverter();
}