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


Java ObjectMapper类代码示例

本文整理汇总了Java中com.mashape.unirest.http.ObjectMapper的典型用法代码示例。如果您正苦于以下问题:Java ObjectMapper类的具体用法?Java ObjectMapper怎么用?Java ObjectMapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ObjectMapper类属于com.mashape.unirest.http包,在下文中一共展示了ObjectMapper类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import com.mashape.unirest.http.ObjectMapper; //导入依赖的package包/类
/**
 * Configure, <code>AIRTABLE_API_KEY</code> passed by Java property,
 * enviroment variable or within credentials.properties.
 *
 * @param objectMapper A custom ObjectMapper implementation
 * @return An Airtable instance configured with supplied ObjectMapper
 * @throws com.sybit.airtable.exception.AirtableException Missing API-Key
 */
@SuppressWarnings("UnusedReturnValue")
public Airtable configure(ObjectMapper objectMapper) throws AirtableException {

    LOG.info("System-Property: Using Java property '-D" + AIRTABLE_API_KEY + "' to get apikey.");
    String airtableApi = System.getProperty(AIRTABLE_API_KEY);

    if (airtableApi == null) {
        LOG.info("Environment-Variable: Using OS environment '" + AIRTABLE_API_KEY + "' to get apikey.");
        airtableApi = System.getenv(AIRTABLE_API_KEY);
    }
    if (airtableApi == null) {
        airtableApi = getCredentialProperty(AIRTABLE_API_KEY);
    }

    return this.configure(airtableApi, objectMapper);
}
 
开发者ID:Sybit-Education,项目名称:airtable.java,代码行数:25,代码来源:Airtable.java

示例2: BotConnectorClientFactory

import com.mashape.unirest.http.ObjectMapper; //导入依赖的package包/类
private BotConnectorClientFactory() {
  Unirest.setObjectMapper(new ObjectMapper() {
    @Override
    public <T> T readValue(String s, Class<T> aClass) {
      return SerializerFacade.fromJsonString(aClass, s);
    }

    @Override
    public String writeValue(Object o) {
      return SerializerFacade.toJsonString(o.getClass(), o);
    }
  });
}
 
开发者ID:waveaccess,项目名称:msbotframework4j,代码行数:14,代码来源:BotConnectorClientFactory.java

示例3: JacksonObjectMapper

import com.mashape.unirest.http.ObjectMapper; //导入依赖的package包/类
public JacksonObjectMapper() {
    jacksonObjectMapper = new com.fasterxml.jackson.databind.ObjectMapper()
            .disable(FAIL_ON_UNKNOWN_PROPERTIES);
}
 
开发者ID:groovejames,项目名称:groovejames,代码行数:5,代码来源:JacksonObjectMapper.java

示例4: KintoClient

import com.mashape.unirest.http.ObjectMapper; //导入依赖的package包/类
/**
 * {@link KintoClient} constructor that allows to specify a remote kinto installation as well as an
 * {@link ObjectMapper} that will allow unmarshalling of responses as objects (that must be properly annotated
 * with jackson annotations).
 * @param remote The remote URL. Must contain the version
 * @param objectMapper {@link ObjectMapper} to use for deserialization
 * @throws IllegalArgumentException if remote is null or an empty String or if headers is null
 */
public KintoClient(String remote, ObjectMapper objectMapper) {
    this(remote);
    Unirest.setObjectMapper(objectMapper);
}
 
开发者ID:intesens,项目名称:kinto-http-java,代码行数:13,代码来源:KintoClient.java


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