@Override public JsonFormat.Value findExpectedFormat(JsonFormat.Value defValue) { // 15-Apr-2016, tatu: Let's check both per-type defaults and annotations; per-type // defaults having higher precedence, so start with that if (_annotationIntrospector != null) { JsonFormat.Value v = _annotationIntrospector.findFormat(_classInfo); if (v != null) { if (defValue == null) { defValue = v; } else { defValue = defValue.withOverrides(v); } } } JsonFormat.Value v = _config.getDefaultPropertyFormat(_classInfo.getRawType()); if (v != null) { if (defValue == null) { defValue = v; } else { defValue = defValue.withOverrides(v); } } return defValue; }
@Override public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType) { // 15-Apr-2016, tatu: Let's calculate lazily, retain; assumption being however that // baseType is always the same JsonFormat.Value v = _propertyFormat; if (v == null) { JsonFormat.Value v1 = config.getDefaultPropertyFormat(baseType); JsonFormat.Value v2 = null; AnnotationIntrospector intr = config.getAnnotationIntrospector(); if (intr != null) { AnnotatedMember member = getMember(); if (member != null) { v2 = intr.findFormat(member); } } if (v1 == null) { v = (v2 == null) ? EMPTY_FORMAT : v2; } else { v = (v2 == null) ? v1 : v1.withOverrides(v2); } _propertyFormat = v; } return v; }
@Override public JsonFormat.Value findExpectedFormat(JsonFormat.Value defValue) { // 15-Apr-2016, tatu: Let's check both per-type defaults and annotations; per-type // defaults having higher precedence, so start with that if (_annotationIntrospector != null) { JsonFormat.Value v = _annotationIntrospector.findFormat(_classInfo); if (v != null) { if (defValue == null) { defValue = v; } else { defValue = defValue.withOverrides(v); } } } JsonFormat.Value v = _config.getDefaultPropertyFormat(_classInfo.getRawType()); if (v != null) { if (defValue == null) { defValue = v; } else { defValue = defValue.withOverrides(v); } } return defValue; }
@Override public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType) { // 15-Apr-2016, tatu: Let's calculate lazily, retain; assumption being however that // baseType is always the same JsonFormat.Value v = _propertyFormat; if (v == null) { JsonFormat.Value v1 = config.getDefaultPropertyFormat(baseType); JsonFormat.Value v2 = null; AnnotationIntrospector intr = config.getAnnotationIntrospector(); if (intr != null) { AnnotatedMember member = getMember(); if (member != null) { v2 = intr.findFormat(member); } } if (v1 == null) { v = (v2 == null) ? EMPTY_FORMAT : v2; } else { v = (v2 == null) ? v1 : v1.withOverrides(v2); } _propertyFormat = v; } return v; }
/** * Helper method that will try to combine values from two {@link Value} * instances, using one as base settings, and the other as overrides * to use instead of base values when defined; base values are only * use if override does not specify a value (matching value is null * or logically missing). * Note that one or both of value instances may be `null`, directly; * if both are `null`, result will also be `null`; otherwise never null. * * @since 2.8 */ public static Value merge(Value base, Value overrides) { return (base == null) ? overrides : base.withOverrides(overrides); }
@Override public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType) { JsonFormat.Value v0 = config.getDefaultPropertyFormat(baseType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); if ((intr == null) || (_member == null)) { return v0; } JsonFormat.Value v = intr.findFormat(_member); if (v == null) { return v0; } return v0.withOverrides(v); }
@Override public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType) { JsonFormat.Value v0 = config.getDefaultPropertyFormat(baseType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); if ((intr == null) || (_member == null)) { return v0; } JsonFormat.Value v = intr.findFormat(_member); if (v == null) { return v0; } return v0.withOverrides(v); }
/** * @since 2.8 */ public static Value mergeAll(Value... values) { Value result = null; for (Value curr : values) { if (curr != null) { result = (result == null) ? curr : result.withOverrides(curr); } } return result; }
@Override public JsonFormat.Value findFormat(Annotated ann) { JsonFormat.Value v1 = _primary.findFormat(ann); JsonFormat.Value v2 = _secondary.findFormat(ann); if (v2 == null) { // shouldn't occur but just in case return v1; } return v2.withOverrides(v1); }
@Override public JsonFormat.Value findFormat(Annotated ann) { JsonFormat.Value v1 = _primary.findFormat(ann); JsonFormat.Value v2 = _secondary.findFormat(ann); if (v2 == null) { // shouldn't occur but just in case return v1; } return v2.withOverrides(v1); }
/** * Helper method that will try to combine values from two {@link Value} * instances, using one as base settings, and the other as overrides * to use instead of base values when defined; base values are only * use if override does not specify a value (matching value is null * or logically missing). * Note that one or both of value instances may be `null`, directly; * if both are `null`, result will also be `null`; otherwise never null. */ public static Value merge(Value base, Value overrides) { return (base == null) ? overrides : base.withOverrides(overrides); }
public static Value mergeAll(Value... values) { Value result = null; for (Value curr : values) { if (curr != null) { result = (result == null) ? curr : result.withOverrides(curr); } } return result; }
@Override public JsonFormat.Value findExpectedFormat(JsonFormat.Value defValue) { // 15-Apr-2016, tatu: Let's check both per-type defaults and annotations; per-type // defaults having higher precedence, so start with that if (_annotationIntrospector != null) { JsonFormat.Value v = _annotationIntrospector.findFormat(_classInfo); if (v != null) { if (defValue == null) { defValue = v; } else { defValue = defValue.withOverrides(v); } } } JsonFormat.Value v = _config.getDefaultPropertyFormat(_classInfo.getRawType()); if (v != null) { if (defValue == null) { defValue = v; } else { defValue = defValue.withOverrides(v); } } return defValue; }
@Override public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType) { // 15-Apr-2016, tatu: Let's calculate lazily, retain; assumption being however that // baseType is always the same JsonFormat.Value v = _propertyFormat; if (v == null) { JsonFormat.Value v1 = config.getDefaultPropertyFormat(baseType); JsonFormat.Value v2 = null; AnnotationIntrospector intr = config.getAnnotationIntrospector(); if (intr != null) { AnnotatedMember member = getMember(); if (member != null) { v2 = intr.findFormat(member); } } if (v1 == null) { v = (v2 == null) ? EMPTY_FORMAT : v2; } else { v = (v2 == null) ? v1 : v1.withOverrides(v2); } _propertyFormat = v; } return v; }
/** * Helper method that will try to combine values from two {@link Value} * instances, using one as base settings, and the other as overrides * to use instead of base values when defined; base values are only * use if override does not specify a value (matching value is null * or logically missing). * Note that one or both of value instances may be `null`, directly; * if both are `null`, result will also be `null`; otherwise never null. * * @since 2.8 */ public static Value merge(Value base, Value overrides) { return (base == null) ? overrides : base.withOverrides(overrides); }
/** * @since 2.8 */ public static Value mergeAll(Value... values) { Value result = null; for (Value curr : values) { if (curr != null) { result = (result == null) ? curr : result.withOverrides(curr); } } return result; }
/** * Helper method that will try to combine values from two {@link Value} * instances, using one as base settings, and the other as overrides * to use instead of base values when defined; base values are only * use if override does not specify a value (matching value is null * or logically missing). * Note that one or both of value instances may be `null`, directly; * if both are `null`, result will also be `null`; otherwise never null. * * @since 2.8 */ public static Value merge(Value base, Value overrides) { return (base == null) ? overrides : base.withOverrides(overrides); }
@Override public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType) { JsonFormat.Value v0 = config.getDefaultPropertyFormat(baseType); AnnotationIntrospector intr = config.getAnnotationIntrospector(); if ((intr == null) || (_member == null)) { return v0; } JsonFormat.Value v = intr.findFormat(_member); if (v == null) { return v0; } return v0.withOverrides(v); }
/** * @since 2.8 */ public static Value mergeAll(Value... values) { Value result = null; for (Value curr : values) { if (curr != null) { result = (result == null) ? curr : result.withOverrides(curr); } } return result; }
@Override public JsonFormat.Value findFormat(Annotated ann) { JsonFormat.Value v1 = _primary.findFormat(ann); JsonFormat.Value v2 = _secondary.findFormat(ann); if (v2 == null) { // shouldn't occur but just in case return v1; } return v2.withOverrides(v1); }