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


Java JsonSetter类代码示例

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


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

示例1: setGeolocation

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
/**
 * Methods to deal with nested TagEvent JSON structure. Jackson black magic can deal with it using
 * annotations. So some attributes have to be deserialized in an alternative way.
 * @param geolocation
 */
@JsonSetter("geolocation")
public void setGeolocation(LinkedHashMap geolocation) {
    try {
        if (geolocation.containsKey("zone"))
            this.geoZone= geolocation.get("zone").toString();
        if (geolocation.containsKey("latitude"))
            this.latitude= Double.parseDouble(geolocation.get("latitude").toString());
        if (geolocation.containsKey("longitude"))
            this.longitude= Double.parseDouble(geolocation.get("longitude").toString());

        if (geolocation.containsKey("region") && geolocation.get("region") instanceof LinkedHashMap)  {
            LinkedHashMap<String, String> region= (LinkedHashMap) geolocation.get("region");
            if (region.containsKey("country"))
                this.geoRegionCountry= region.get("country").toString();
            if (region.containsKey("locality"))
                this.geoRegionLocality= region.get("locality").toString();
        }
    }   catch (Exception ex)    {
        log.error("Unable to parse the TagEvent(geolocation): " + geolocation + ", Exception: " + ex.getMessage());
    }

}
 
开发者ID:aaitor,项目名称:flink-charts,代码行数:28,代码来源:TagEvent.java

示例2: setDate

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
/**
 * Sets Date when the asset was purchased or licensed.
 * @param date Date when the asset was purchased or licensed.
 * @throws StockException if date format is not valid
 */
@JsonSetter("date")
public void setDate(final String date) throws StockException {
    String formatString = "yyyy-MM-dd hh:mm:ss";
    // date format with milliseconds
    SimpleDateFormat format = new SimpleDateFormat(
            formatString + ".SSS");
    // date format without milliseconds
    SimpleDateFormat formatWithoutMS = new SimpleDateFormat(
            formatString);
    try {
        if (date.length() <= formatString.length()) {
            this.mDate = formatWithoutMS.parse(date);
        } else {
            this.mDate = format.parse(date);
        }
    } catch (ParseException e) {
        throw new StockException("Could not parse the date string");
    }
}
 
开发者ID:adobe,项目名称:stock-api-sdk,代码行数:25,代码来源:LicensePurchaseDetails.java

示例3: setFullEntitlementQuota

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
/**
 * Sets Full quota of the user available entitlements.
 * @param node object containing full quota of user available entitlements.
 * @throws Exception if could not parse node object
 */
@JsonSetter("full_entitlement_quota")
public void setFullEntitlementQuota(
        final JsonNode node) throws Exception {
    if (node != null && node.isObject()) {
            ObjectMapper mapper = new ObjectMapper();
            this.mFullEntitlementQuota = mapper.readValue(
                    node.toString(), LicenseEntitlementQuota.class);
    }
}
 
开发者ID:adobe,项目名称:stock-api-sdk,代码行数:15,代码来源:LicenseEntitlement.java

示例4: setViolincello

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("violincello")
public void setViolincello(int violincello) {
    _violincello = violincello;
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:5,代码来源:Instrumentation.java

示例5: setUsername

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("username")
public void setUsername(String username) {
    _username = username;
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:5,代码来源:Account.java

示例6: setViolin2

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("violin2")
public void setViolin2(int violin2) {
    _violin2 = violin2;
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:5,代码来源:Instrumentation.java

示例7: setTube

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("tube")
public void setTube(int tube) {
    _tube = tube;
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:5,代码来源:Instrumentation.java

示例8: setQuota

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
/**
 * Sets quantity of remaining licenses available for the user.
 * @param quota license quantity
 */
@JsonSetter("quota")
public void setQuota(final Integer quota) {
    this.mQuota = quota;
}
 
开发者ID:adobe,项目名称:stock-api-sdk,代码行数:9,代码来源:LicenseEntitlement.java

示例9: setTrombone

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("trombone")
public void setTrombone(int trombone) {
    _trombone = trombone;
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:5,代码来源:Instrumentation.java

示例10: setRefreshTokenValiditySecondsAlias

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("refresh-token-validity-seconds")
public void setRefreshTokenValiditySecondsAlias(Integer refreshTokenValiditySeconds) {
    this.refreshTokenValiditySeconds = refreshTokenValiditySeconds;
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:5,代码来源:TenantProperties.java

示例11: setViola

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("viola")
public void setViola(int viola) {
    _viola = viola;
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:5,代码来源:Instrumentation.java

示例12: setLicenseState

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
/**
 * Sets Asset licensing state.
 * @param licenseState Asset licensing state
 */
@JsonSetter("license")
public void setLicenseState(final AssetLicenseState licenseState) {
    this.mLicenseState = licenseState;
}
 
开发者ID:adobe,项目名称:stock-api-sdk,代码行数:9,代码来源:LicensePurchaseDetails.java

示例13: setPhoneNumber

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("phone_number")
public void setPhoneNumber(String phoneNumber) {
    _phoneNumber = phoneNumber;
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:5,代码来源:Person.java

示例14: setContentType

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
/**
 * Sets Type of the licensed asset.
 * @param contentType Type of the licensed asset.
 */
@JsonSetter("content_type")
public void setContentType(final String contentType) {
    this.mContentType = contentType;
}
 
开发者ID:adobe,项目名称:stock-api-sdk,代码行数:9,代码来源:LicensePurchaseDetails.java

示例15: setMessages

import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
/** SETTER
 * TODO: Write general description for this method
 */
@JsonSetter("messages")
public void setMessages (List<Object> value) { 
    this.messages = value;
}
 
开发者ID:messagemedia,项目名称:messages-java-sdk,代码行数:8,代码来源:SendMessagesResponse.java


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