当前位置: 首页>>代码示例>>Java>>正文


Java SimpleXMLConverter类代码示例

本文整理汇总了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++;
	}
}
 
开发者ID:tsuyosh,项目名称:RetrofitExamples,代码行数:27,代码来源:Main.java

示例2: CatService

import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
private CatService() {
    mAsyncRestAdapter = new RestAdapter.Builder()
            .setEndpoint(API_URL)
            .setConverter(new SimpleXMLConverter())
            .setLogLevel(RestAdapter.LogLevel.FULL)
            .build();
}
 
开发者ID:ZkHaider,项目名称:CodePath-TodoApp,代码行数:8,代码来源:CatService.java

示例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);
}
 
开发者ID:gotokatsuya,项目名称:Easy,代码行数:9,代码来源:RssClient.java

示例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);
}
 
开发者ID:ipragmatech,项目名称:OAuth-Magento-Rest-Api-Retrofit,代码行数:10,代码来源:ServiceGenerator.java

示例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();
}
 
开发者ID:nekofar,项目名称:binamcast,代码行数:9,代码来源:RetrofitModule.java

示例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;
    }
 
开发者ID:jerrellmardis,项目名称:Amphitheatre,代码行数:13,代码来源:TVDBClient.java

示例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);
}
 
开发者ID:clintonhealthaccess,项目名称:chailmis-android,代码行数:10,代码来源:FDroidEndPointFactory.java

示例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);
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:57,代码来源:TalkClient.java

示例9: provideConverter

import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
@Provides
@Singleton
Converter provideConverter()
{
	return new SimpleXMLConverter();
}
 
开发者ID:jeksor,项目名称:justweather,代码行数:7,代码来源:NetworkModule.java

示例10: getFlickrApiConverter

import retrofit.converter.SimpleXMLConverter; //导入依赖的package包/类
private Converter getFlickrApiConverter() {
    return new SimpleXMLConverter();
}
 
开发者ID:desseim,项目名称:flickr-searcher,代码行数:4,代码来源:ApplicationModule.java


注:本文中的retrofit.converter.SimpleXMLConverter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。