當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。