@Override public String findPropertyNameForParam(AnnotatedParameter param) { if (param != null) { JsonProperty pann = param.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } /* And can not use JsonDeserialize as we can not use * name auto-detection (names of local variables including * parameters are not necessarily preserved in bytecode) */ } return null; }
@Override public String findSerializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonSerialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonSerialize.class) || af.hasAnnotation(JsonView.class)) { return ""; } return null; }
@Override public String findDeserializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonDeserialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonDeserialize.class) || af.hasAnnotation(JsonView.class) || af.hasAnnotation(JsonBackReference.class) || af.hasAnnotation(JsonManagedReference.class) ) { return ""; } return null; }
@SuppressWarnings("deprecation") @Override public String findGettablePropertyName(AnnotatedMethod am) { /* 22-May-2009, tatu: JsonProperty is the primary annotation * to check for */ JsonProperty pann = am.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } /* 22-May-2009, tatu: JsonGetter is deprecated as of 1.1 * but still supported */ JsonGetter ann = am.getAnnotation(JsonGetter.class); if (ann != null) { return ann.value(); } /* 22-May-2009, tatu: And finally, JsonSerialize implies * that there is a property, although doesn't define name */ // 09-Apr-2010, tatu: Ditto for JsonView if (am.hasAnnotation(JsonSerialize.class) || am.hasAnnotation(JsonView.class)) { return ""; } return null; }
return pann.value();
@Override public String findPropertyNameForParam(AnnotatedParameter param) { if (param != null) { JsonProperty pann = param.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } /* And can not use JsonDeserialize as we can not use * name auto-detection (names of local variables including * parameters are not necessarily preserved in bytecode) */ } return null; }
@Override public String findSerializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonSerialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonSerialize.class) || af.hasAnnotation(JsonView.class)) { return ""; } return null; }
@Override public String findDeserializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonDeserialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonDeserialize.class) || af.hasAnnotation(JsonView.class) || af.hasAnnotation(JsonBackReference.class) || af.hasAnnotation(JsonManagedReference.class) ) { return ""; } return null; }
@SuppressWarnings("deprecation") @Override public String findGettablePropertyName(AnnotatedMethod am) { /* 22-May-2009, tatu: JsonProperty is the primary annotation * to check for */ JsonProperty pann = am.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } /* 22-May-2009, tatu: JsonGetter is deprecated as of 1.1 * but still supported */ JsonGetter ann = am.getAnnotation(JsonGetter.class); if (ann != null) { return ann.value(); } /* 22-May-2009, tatu: And finally, JsonSerialize implies * that there is a property, although doesn't define name */ // 09-Apr-2010, tatu: Ditto for JsonView if (am.hasAnnotation(JsonSerialize.class) || am.hasAnnotation(JsonView.class)) { return ""; } return null; }
return pann.value();
@Override public String findPropertyNameForParam(AnnotatedParameter param) { if (param != null) { JsonProperty pann = param.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } /* And can not use JsonDeserialize as we can not use * name auto-detection (names of local variables including * parameters are not necessarily preserved in bytecode) */ } return null; }
private String translateWithAnnotation(JsonProperty jsonPropertyAnn, String defaultName) { if (jsonPropertyAnn != null) { String propertyName = jsonPropertyAnn.value(); if (StringUtils.isNotBlank(propertyName)) { return propertyName; } } return translate(defaultName); }
@Override public String findSerializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonSerialize implies it is such a property if (af.hasAnnotation(JsonSerialize.class)) { return ""; } return null; }
@Override public String findDeserializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonDeserialize implies it is such a property if (af.hasAnnotation(JsonDeserialize.class)) { return ""; } return null; }
@Override public String findSerializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonSerialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonSerialize.class) || af.hasAnnotation(JsonView.class)) { return ""; } return null; }
@Override public String getPropertyName(DecoratedExecutableElement method) { JsonProperty jsonProperty = method.getAnnotation(JsonProperty.class); if (jsonProperty != null) { String propertyName = jsonProperty.value(); if (!propertyName.isEmpty()) { return propertyName; } } if (method.isGetter() || method.isSetter()) { return method.getPropertyName(); } return method.getSimpleName().toString(); } }
@Override public String findSerializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonSerialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonSerialize.class) || af.hasAnnotation(JsonView.class)) { return ""; } return null; }
@Override public String findDeserializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonDeserialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonDeserialize.class) || af.hasAnnotation(JsonView.class)) { return ""; } return null; }
@Override public String findSerializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonSerialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonSerialize.class) || af.hasAnnotation(JsonView.class)) { return ""; } return null; }
@Override public String findDeserializablePropertyName(AnnotatedField af) { JsonProperty pann = af.getAnnotation(JsonProperty.class); if (pann != null) { return pann.value(); } // Also: having JsonDeserialize implies it is such a property // 09-Apr-2010, tatu: Ditto for JsonView if (af.hasAnnotation(JsonDeserialize.class) || af.hasAnnotation(JsonView.class)) { return ""; } return null; }