@Override public final JsonFormat.Value getDefaultPropertyFormat(Class<?> type) { ConfigOverride overrides = _configOverrides.findOverride(type); if (overrides != null) { JsonFormat.Value v = overrides.getFormat(); if (v != null) { return v; } } return EMPTY_FORMAT; }
@Override public final JsonIgnoreProperties.Value getDefaultPropertyIgnorals(Class<?> type) { ConfigOverride overrides = _configOverrides.findOverride(type); if (overrides != null) { JsonIgnoreProperties.Value v = overrides.getIgnorals(); if (v != null) { return v; } } // 01-May-2015, tatu: Could return `Value.empty()` but for now `null` // seems simpler as callers can avoid processing. return null; }
/** * Accessor for default property inclusion to use for serialization, * considering possible per-type override for given base type; but * if none found, returning given <code>defaultIncl</code> * * @param defaultIncl Inclusion setting to return if no overrides found. * * @since 2.8.2 */ public JsonInclude.Value getDefaultPropertyInclusion(Class<?> baseType, JsonInclude.Value defaultIncl) { JsonInclude.Value v = getConfigOverride(baseType).getInclude(); if (v != null) { return v; } return defaultIncl; }
/** * 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; }
/** * Helper method that will check whether given raw type is marked as always ignorable * (for purpose of ignoring properties with type) */ protected boolean isIgnorableType(DeserializationConfig config, BeanPropertyDefinition propDef, Class<?> type, Map<Class<?>,Boolean> ignoredTypes) { Boolean status = ignoredTypes.get(type); if (status != null) { return status.booleanValue(); } // 22-Oct-2016, tatu: Slight check to skip primitives, String if ((type == String.class) || type.isPrimitive()) { status = Boolean.FALSE; } else { // 21-Apr-2016, tatu: For 2.8, can specify config overrides status = config.getConfigOverride(type).getIsIgnoredType(); if (status == null) { BeanDescription desc = config.introspectClassAnnotations(type); status = config.getAnnotationIntrospector().isIgnorableType(desc.getClassInfo()); // We default to 'false', i.e. not ignorable if (status == null) { status = Boolean.FALSE; } } } ignoredTypes.put(type, status); return status.booleanValue(); }
Class<?> rawType = getRawPrimaryType(); ConfigOverride co = _config.getConfigOverride(rawType); JsonSetter.Value setterInfo = co.getSetterInfo(); if (setterInfo != null) { if (valueNulls == null) { Boolean b = co.getMergeable(); if (b != null) { needMerge = false;
@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); }
@Override public Boolean getDefaultMergeable(Class<?> baseType) { Boolean b; ConfigOverride cfg = _configOverrides.findOverride(baseType); if (cfg != null) { b = cfg.getMergeable(); if (b != null) { return b; } } return _configOverrides.getDefaultMergeable(); }
@Override // since 2.9 public final VisibilityChecker<?> getDefaultVisibilityChecker(Class<?> baseType, AnnotatedClass actualClass) { VisibilityChecker<?> vc = getDefaultVisibilityChecker(); AnnotationIntrospector intr = getAnnotationIntrospector(); if (intr != null) { vc = intr.findAutoDetectVisibility(actualClass, vc); } ConfigOverride overrides = _configOverrides.findOverride(baseType); if (overrides != null) { vc = vc.withOverrides(overrides.getVisibility()); // ok to pass null } return vc; }
protected final static ConfigOverride EMPTY_OVERRIDE = ConfigOverride.empty();
if (result == null) { result = config.getConfigOverride(type).getIsIgnoredType(); if (result == null) { BeanDescription desc = config.introspectClassAnnotations(type);
/** * 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; }
Class<?> rawType = getRawPrimaryType(); ConfigOverride co = _config.getConfigOverride(rawType); JsonSetter.Value setterInfo = co.getSetterInfo(); if (setterInfo != null) { if (valueNulls == null) { Boolean b = co.getMergeable(); if (b != null) { needMerge = false;
@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); }
@Override public Boolean getDefaultMergeable(Class<?> baseType) { Boolean b; ConfigOverride cfg = _configOverrides.findOverride(baseType); if (cfg != null) { b = cfg.getMergeable(); if (b != null) { return b; } } return _configOverrides.getDefaultMergeable(); }
@Override // since 2.9 public final VisibilityChecker<?> getDefaultVisibilityChecker(Class<?> baseType, AnnotatedClass actualClass) { VisibilityChecker<?> vc = getDefaultVisibilityChecker(); AnnotationIntrospector intr = getAnnotationIntrospector(); if (intr != null) { vc = intr.findAutoDetectVisibility(actualClass, vc); } ConfigOverride overrides = _configOverrides.findOverride(baseType); if (overrides != null) { vc = vc.withOverrides(overrides.getVisibility()); // ok to pass null } return vc; }
protected final static ConfigOverride EMPTY_OVERRIDE = ConfigOverride.empty();
@Override public final JsonInclude.Value getDefaultPropertyInclusion(Class<?> baseType) { JsonInclude.Value v = getConfigOverride(baseType).getInclude(); JsonInclude.Value def = getDefaultPropertyInclusion(); if (def == null) { return v; } return def.withOverrides(v); }
/** * Helper method that will check whether given raw type is marked as always ignorable * (for purpose of ignoring properties with type) */ protected boolean isIgnorableType(DeserializationConfig config, BeanPropertyDefinition propDef, Class<?> type, Map<Class<?>,Boolean> ignoredTypes) { Boolean status = ignoredTypes.get(type); if (status != null) { return status.booleanValue(); } // 22-Oct-2016, tatu: Slight check to skip primitives, String if ((type == String.class) || type.isPrimitive()) { status = Boolean.FALSE; } else { // 21-Apr-2016, tatu: For 2.8, can specify config overrides status = config.getConfigOverride(type).getIsIgnoredType(); if (status == null) { BeanDescription desc = config.introspectClassAnnotations(type); status = config.getAnnotationIntrospector().isIgnorableType(desc.getClassInfo()); // We default to 'false', i.e. not ignorable if (status == null) { status = Boolean.FALSE; } } } ignoredTypes.put(type, status); return status.booleanValue(); }
@Override public final JsonFormat.Value getDefaultPropertyFormat(Class<?> type) { ConfigOverride overrides = _configOverrides.findOverride(type); if (overrides != null) { JsonFormat.Value v = overrides.getFormat(); if (v != null) { return v; } } return EMPTY_FORMAT; }