本文整理匯總了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;
}