本文整理汇总了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());
}
}
示例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");
}
}
示例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);
}
}
示例4: setViolincello
import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("violincello")
public void setViolincello(int violincello) {
_violincello = violincello;
}
示例5: setUsername
import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("username")
public void setUsername(String username) {
_username = username;
}
示例6: setViolin2
import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("violin2")
public void setViolin2(int violin2) {
_violin2 = violin2;
}
示例7: setTube
import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("tube")
public void setTube(int tube) {
_tube = tube;
}
示例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;
}
示例9: setTrombone
import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("trombone")
public void setTrombone(int trombone) {
_trombone = trombone;
}
示例10: setRefreshTokenValiditySecondsAlias
import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("refresh-token-validity-seconds")
public void setRefreshTokenValiditySecondsAlias(Integer refreshTokenValiditySeconds) {
this.refreshTokenValiditySeconds = refreshTokenValiditySeconds;
}
示例11: setViola
import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("viola")
public void setViola(int viola) {
_viola = viola;
}
示例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;
}
示例13: setPhoneNumber
import com.fasterxml.jackson.annotation.JsonSetter; //导入依赖的package包/类
@JsonSetter("phone_number")
public void setPhoneNumber(String phoneNumber) {
_phoneNumber = phoneNumber;
}
示例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;
}
示例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;
}