@JsonSetter("crypto") public void setCrypto(Crypto crypto) { this.crypto = crypto; }
@Override public PropertyName findNameForDeserialization(Annotated a) { // @JsonSetter has precedence over @JsonProperty, being more specific boolean useDefault = false; JsonSetter js = _findAnnotation(a, JsonSetter.class); if (js != null) { String s = js.value(); // 04-May-2018, tatu: Need to allow for "nameless" `@JsonSetter` too if (s.isEmpty()) { useDefault = true; } else { return PropertyName.construct(s); } } JsonProperty pann = _findAnnotation(a, JsonProperty.class); if (pann != null) { return PropertyName.construct(pann.value()); } if (useDefault || _hasOneOf(a, ANNOTATIONS_TO_INFER_DESER)) { return PropertyName.USE_DEFAULT; } return null; }
public static Value from(JsonSetter src) { if (src == null) { return EMPTY; } return construct(src.nulls(), src.contentNulls()); }
@JsonSetter("class") default void setClassName(final String className) { // ignore the className as it will be picked up by the JsonTypeInfo annotation. }
if (null != params && 1 == params.length) { final JsonSetter jsonSetter = method.getAnnotation(JsonSetter.class); if (null != jsonSetter && propName.equals(jsonSetter.value())) { matchedMethod = method; break;
public static Value from(JsonSetter src) { if (src == null) { return EMPTY; } return construct(src.nulls(), src.contentNulls()); }
@JsonSetter("class") void setClassName(final String className) { // ignore the className as it will be picked up by the JsonTypeInfo annotation. }
public static Value from(JsonSetter src) { if (src == null) { return EMPTY; } return construct(src.nulls(), src.contentNulls()); }
@JsonSetter("statistic") public HistoryTrendItem setStatistic(final Statistic statistic) { this.data = statistic; return this; } }
@JsonSetter("action") private void setActionWithoutValidation(String action) { this.action = action; }
@JsonSetter("channel") public void setChannel(JsonNode jsonNode) { if (jsonNode.isObject()) { try { this.channel = new ObjectMapper().treeToValue(jsonNode, Channel.class); } catch (JsonProcessingException e) { logger.error("Error deserializing json: ", e); } } else if (jsonNode.isTextual()) { this.channelId = jsonNode.asText(); } }
@JsonSetter("user") public void setUser(JsonNode jsonNode) { if (jsonNode.isObject()) { try { this.user = new ObjectMapper().treeToValue(jsonNode, User.class); } catch (JsonProcessingException e) { logger.error("Error deserializing json: ", e); } } else if (jsonNode.isTextual()) { this.userId = jsonNode.asText(); } }
@JsonSetter("file") public void setFile(JsonNode jsonNode) { if (jsonNode.isObject()) { try { this.file = new ObjectMapper().treeToValue(jsonNode, File.class); } catch (JsonProcessingException e) { logger.error("Error deserializing json: ", e); } } else if (jsonNode.isTextual()) { this.fileId = jsonNode.asText(); } }
@JsonSetter("comment") public void setComment(JsonNode jsonNode) { if (jsonNode.isObject()) { try { this.comment = new ObjectMapper().treeToValue(jsonNode, Comment.class); } catch (JsonProcessingException e) { logger.error("Error deserializing json: ", e); } } else if (jsonNode.isTextual()) { this.commentId = jsonNode.asText(); } }
@JsonSetter("Crypto") // older wallet files may have this attribute name public void setCryptoV1(Crypto crypto) { setCrypto(crypto); }
@JsonSetter("properties") public CHILD_CLASS properties(final Set<String> properties) { if (null != properties && null != elDef.excludeProperties && !elDef.excludeProperties.isEmpty()) { throw new IllegalArgumentException("You cannot set both properties and excludeProperties"); } elDef.properties = properties; return self(); }
@JsonSetter("field1") void setField1Json(final String field1) { this.field1 = field1; } }
@JsonSetter("excludeProperties") public CHILD_CLASS excludeProperties(final Set<String> excludeProperties) { if (null != excludeProperties && !excludeProperties.isEmpty() && null != elDef.properties) { throw new IllegalArgumentException("You cannot set both properties and excludeProperties"); } elDef.excludeProperties = excludeProperties; return self(); }
@JsonSetter("setClass") public void setSetClassString(final String classType) throws ClassNotFoundException { this.setClass = null != classType ? Class.forName(SimpleClassNameIdResolver.getClassName(classType)).asSubclass(Set.class) : null; }
@JsonSetter("objectSerialiser") public void setObjectSerialiserClassString(final String classType) throws ClassNotFoundException, IllegalAccessException, InstantiationException { this.objectSerialiser = null != classType ? Class.forName(SimpleClassNameIdResolver.getClassName(classType)).asSubclass(ToBytesSerialiser.class).newInstance() : null; }