@Override public final JsonInclude.Value getDefaultInclusion(Class<?> baseType, Class<?> propertyType) { JsonInclude.Value v = getConfigOverride(propertyType).getIncludeAsProperty(); JsonInclude.Value def = getDefaultPropertyInclusion(baseType); if (def == null) { return v; } return def.withOverrides(v); }
/** * Accessor for default property inclusion to use for serialization, * considering possible per-type override for given base type and * possible per-type override for given property type; but * if none found, returning given <code>defaultIncl</code> * * @param baseType Type of the instance containing the targeted property. * @param propertyType Type of the property to look up inclusion setting for. * @param defaultIncl Inclusion setting to return if no overrides found. * * @since 2.9 */ public JsonInclude.Value getDefaultInclusion(Class<?> baseType, Class<?> propertyType, JsonInclude.Value defaultIncl) { JsonInclude.Value baseOverride = getConfigOverride(baseType).getInclude(); JsonInclude.Value propOverride = getConfigOverride(propertyType).getIncludeAsProperty(); JsonInclude.Value result = JsonInclude.Value.mergeAll(defaultIncl, baseOverride, propOverride); return result; }
@Override public final JsonInclude.Value getDefaultInclusion(Class<?> baseType, Class<?> propertyType) { JsonInclude.Value v = getConfigOverride(propertyType).getIncludeAsProperty(); JsonInclude.Value def = getDefaultPropertyInclusion(baseType); if (def == null) { return v; } return def.withOverrides(v); }
/** * Accessor for default property inclusion to use for serialization, * considering possible per-type override for given base type and * possible per-type override for given property type; but * if none found, returning given <code>defaultIncl</code> * * @param baseType Type of the instance containing the targeted property. * @param propertyType Type of the property to look up inclusion setting for. * @param defaultIncl Inclusion setting to return if no overrides found. * * @since 2.9 */ public JsonInclude.Value getDefaultInclusion(Class<?> baseType, Class<?> propertyType, JsonInclude.Value defaultIncl) { JsonInclude.Value baseOverride = getConfigOverride(baseType).getInclude(); JsonInclude.Value propOverride = getConfigOverride(propertyType).getIncludeAsProperty(); JsonInclude.Value result = JsonInclude.Value.mergeAll(defaultIncl, baseOverride, propOverride); return result; }