protected final static JsonInclude.Value EMPTY_INCLUDE = JsonInclude.Value.empty();
public PropertyBuilder(SerializationConfig config, BeanDescription beanDesc) { _config = config; _beanDesc = beanDesc; // 08-Sep-2016, tatu: This gets tricky, with 3 levels of definitions: // (a) global default inclusion // (b) per-type default inclusion (from annotation or config overrides; // config override having precedence) // (c) per-property override (from annotation on specific property or // config overrides per type of property; // annotation having precedence) // // and not only requiring merging, but also considering special handling // for NON_DEFAULT in case of (b) (vs (a) or (c)) JsonInclude.Value inclPerType = JsonInclude.Value.merge( beanDesc.findPropertyInclusion(JsonInclude.Value.empty()), config.getDefaultPropertyInclusion(beanDesc.getBeanClass(), JsonInclude.Value.empty())); _defaultInclusion = JsonInclude.Value.merge(config.getDefaultPropertyInclusion(), inclPerType); _useRealPropertyDefaults = inclPerType.getValueInclusion() == JsonInclude.Include.NON_DEFAULT; _annotationIntrospector = _config.getAnnotationIntrospector(); }
public PropertyBuilder(SerializationConfig config, BeanDescription beanDesc) { _config = config; _beanDesc = beanDesc; // 08-Sep-2016, tatu: This gets tricky, with 3 levels of definitions: // (a) global default inclusion // (b) per-type default inclusion (from annotation or config overrides; // latter having precedence // Cc) per-property override // // and not only requiring merging, but also considering special handling // for NON_DEFAULT in case of (b) (vs (a) or (c)) JsonInclude.Value inclPerType = JsonInclude.Value.merge( beanDesc.findPropertyInclusion(JsonInclude.Value.empty()), config.getDefaultPropertyInclusion(beanDesc.getBeanClass(), JsonInclude.Value.empty())); _defaultInclusion = JsonInclude.Value.merge(config.getDefaultPropertyInclusion(), inclPerType); _useRealPropertyDefaults = inclPerType.getValueInclusion() == JsonInclude.Include.NON_DEFAULT; _annotationIntrospector = _config.getAnnotationIntrospector(); }
/** * Method for checking inclusion criteria for a type (Class) or property (yes, method * name is bit unfortunate -- not just for properties!). * In case of class, acts as the default for properties POJO contains; for properties * acts as override for class defaults and possible global defaults. * * @since 2.6 */ public JsonInclude.Value findPropertyInclusion(Annotated a) { return JsonInclude.Value.empty(); }
public ConfigOverrides() { this(null, // !!! TODO: change to (ALWAYS, ALWAYS)? JsonInclude.Value.empty(), JsonSetter.Value.empty(), VisibilityChecker.Std.defaultInstance(), null ); }
@Override // @since 2.7 public JsonInclude.Value findPropertyInclusion(Annotated a) { JsonInclude.Include incl = findSerializationInclusion(a, null); if (incl == null) { return JsonInclude.Value.empty(); } return JsonInclude.Value.construct(incl, null); }
@Override public JsonInclude.Value findInclusion() { AnnotatedMember a = getAccessor(); // 16-Apr-2106, tatu: Let's include per-type default inclusion too // 17-Aug-2016, tatu: Do NOT include global, or per-type defaults, because // not all of this information (specifically, enclosing type's settings) // is available here JsonInclude.Value v = (_annotationIntrospector == null) ? null : _annotationIntrospector.findPropertyInclusion(a); return (v == null) ? JsonInclude.Value.empty() : v; }
@Override // @since 2.7 public JsonInclude.Value findPropertyInclusion(Annotated a) { JsonInclude.Include incl = findSerializationInclusion(a, null); if (incl == null) { return JsonInclude.Value.empty(); } return JsonInclude.Value.construct(incl, null); }
@Override public JsonInclude.Value findPropertyInclusion(Annotated a) { JsonInclude inc = _findAnnotation(a, JsonInclude.class); JsonInclude.Value value = (inc == null) ? JsonInclude.Value.empty() : JsonInclude.Value.from(inc); // only consider deprecated variant if we didn't have non-deprecated one: if (value.getValueInclusion() == JsonInclude.Include.USE_DEFAULTS) { value = _refinePropertyInclusion(a, value); } return value; }
@Override public JsonInclude.Value findInclusion() { AnnotatedMember a = getAccessor(); // 16-Apr-2106, tatu: Let's include per-type default inclusion too // 17-Aug-2016, tatu: Do NOT include global, or per-type defaults, because // not all of this information (specifically, enclosing type's settings) // is available here JsonInclude.Value v = (_annotationIntrospector == null) ? null : _annotationIntrospector.findPropertyInclusion(a); return (v == null) ? JsonInclude.Value.empty() : v; }
/** * Method for checking inclusion criteria for a type (Class) or property (yes, method * name is bit unfortunate -- not just for properties!). * In case of class, acts as the default for properties POJO contains; for properties * acts as override for class defaults and possible global defaults. * * @since 2.6 */ public JsonInclude.Value findPropertyInclusion(Annotated a) { return JsonInclude.Value.empty(); }
@Override // @since 2.7 public JsonInclude.Value findPropertyInclusion(Annotated a) { JsonInclude.Include incl = _serializationInclusion(a, null); if (incl == null) { return JsonInclude.Value.empty(); } return JsonInclude.Value.construct(incl, null); }
protected final static JsonInclude.Value EMPTY_INCLUDE = JsonInclude.Value.empty();
public PropertyBuilder(SerializationConfig config, BeanDescription beanDesc) { _config = config; _beanDesc = beanDesc; // 08-Sep-2016, tatu: This gets tricky, with 3 levels of definitions: // (a) global default inclusion // (b) per-type default inclusion (from annotation or config overrides; // config override having precedence) // (c) per-property override (from annotation on specific property or // config overrides per type of property; // annotation having precedence) // // and not only requiring merging, but also considering special handling // for NON_DEFAULT in case of (b) (vs (a) or (c)) JsonInclude.Value inclPerType = JsonInclude.Value.merge( beanDesc.findPropertyInclusion(JsonInclude.Value.empty()), config.getDefaultPropertyInclusion(beanDesc.getBeanClass(), JsonInclude.Value.empty())); _defaultInclusion = JsonInclude.Value.merge(config.getDefaultPropertyInclusion(), inclPerType); _useRealPropertyDefaults = inclPerType.getValueInclusion() == JsonInclude.Include.NON_DEFAULT; _annotationIntrospector = _config.getAnnotationIntrospector(); }
/** * Method for checking inclusion criteria for a type (Class) or property (yes, method * name is bit unfortunate -- not just for properties!). * In case of class, acts as the default for properties POJO contains; for properties * acts as override for class defaults and possible global defaults. * * @since 2.6 */ public JsonInclude.Value findPropertyInclusion(Annotated a) { return JsonInclude.Value.empty(); }
public ConfigOverrides() { this(null, // !!! TODO: change to (ALWAYS, ALWAYS)? JsonInclude.Value.empty(), JsonSetter.Value.empty(), VisibilityChecker.Std.defaultInstance(), null ); }
@Override public JsonInclude.Value findPropertyInclusion(Annotated a) { JsonInclude inc = _findAnnotation(a, JsonInclude.class); JsonInclude.Value value = (inc == null) ? JsonInclude.Value.empty() : JsonInclude.Value.from(inc); // only consider deprecated variant if we didn't have non-deprecated one: if (value.getValueInclusion() == JsonInclude.Include.USE_DEFAULTS) { value = _refinePropertyInclusion(a, value); } return value; }
@Override public JsonInclude.Value findInclusion() { AnnotatedMember a = getAccessor(); // 16-Apr-2106, tatu: Let's include per-type default inclusion too // 17-Aug-2016, tatu: Do NOT include global, or per-type defaults, because // not all of this information (specifically, enclosing type's settings) // is available here JsonInclude.Value v = (_annotationIntrospector == null) ? null : _annotationIntrospector.findPropertyInclusion(a); return (v == null) ? JsonInclude.Value.empty() : v; }