@Override public final JsonIgnoreProperties.Value getDefaultPropertyIgnorals(Class<?> baseType, AnnotatedClass actualClass) { AnnotationIntrospector intr = getAnnotationIntrospector(); JsonIgnoreProperties.Value base = (intr == null) ? null : intr.findPropertyIgnorals(actualClass); JsonIgnoreProperties.Value overrides = getDefaultPropertyIgnorals(baseType); return JsonIgnoreProperties.Value.merge(base, overrides); }
@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; }
/** * Method for constructing an instance that has specified * value for attribute for given key. * * @since 2.3 */ public T withAttribute(Object key, Object value) { return with(getAttributes().withSharedAttribute(key, value)); }
/** * Method for getting {@link AnnotationIntrospector} configured * to introspect annotation values used for configuration. */ @Override public AnnotationIntrospector getAnnotationIntrospector() { /* 29-Jul-2009, tatu: it's now possible to disable use of * annotations; can be done using "no-op" introspector */ if (isEnabled(MapperFeature.USE_ANNOTATIONS)) { return super.getAnnotationIntrospector(); } return NopAnnotationIntrospector.instance; }
@Override public VisibilityChecker<?> getDefaultVisibilityChecker() { VisibilityChecker<?> vchecker = super.getDefaultVisibilityChecker(); if (!isEnabled(MapperFeature.AUTO_DETECT_SETTERS)) { vchecker = vchecker.withSetterVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_CREATORS)) { vchecker = vchecker.withCreatorVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_FIELDS)) { vchecker = vchecker.withFieldVisibility(Visibility.NONE); } return vchecker; }
/** * Method for constructing and returning a new instance with different * default {@link java.util.Locale} to use for formatting. */ public final T with(Locale l) { return _withBase(_base.with(l)); }
/** * In addition to constructing instance with specified date format, * will enable or disable <code>SerializationFeature.WRITE_DATES_AS_TIMESTAMPS</code> * (enable if format set as null; disable if non-null) */ @Override public SerializationConfig with(DateFormat df) { SerializationConfig cfg = super.with(df); // Also need to toggle this feature based on existence of date format: if (df == null) { return cfg.with(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); } return cfg.without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); }
public T withRootName(String rootName) { if (rootName == null) { return withRootName((PropertyName) null); } return withRootName(PropertyName.construct(rootName)); }
@Override public final VisibilityChecker<?> getDefaultVisibilityChecker() { VisibilityChecker<?> vchecker = _configOverrides.getDefaultVisibility(); // then global overrides (disabling) // 05-Mar-2018, tatu: As per [databind#1947], need to see if any disabled if ((_mapperFeatures & AUTO_DETECT_MASK) != AUTO_DETECT_MASK) { if (!isEnabled(MapperFeature.AUTO_DETECT_FIELDS)) { vchecker = vchecker.withFieldVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_GETTERS)) { vchecker = vchecker.withGetterVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_IS_GETTERS)) { vchecker = vchecker.withIsGetterVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_SETTERS)) { vchecker = vchecker.withSetterVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_CREATORS)) { vchecker = vchecker.withCreatorVisibility(Visibility.NONE); } } return vchecker; }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features disabled. */ @SuppressWarnings("unchecked") @Override public final T without(MapperFeature... features) { int newMapperFlags = _mapperFeatures; for (MapperFeature f : features) { newMapperFlags &= ~f.getMask(); } if (newMapperFlags == _mapperFeatures) { return (T) this; } return _withMapperFeatures(newMapperFlags); }
/** * Method for getting {@link AnnotationIntrospector} configured * to introspect annotation values used for configuration. */ @Override public AnnotationIntrospector getAnnotationIntrospector() { /* 29-Jul-2009, tatu: it's now possible to disable use of * annotations; can be done using "no-op" introspector */ if (isEnabled(MapperFeature.USE_ANNOTATIONS)) { return super.getAnnotationIntrospector(); } return NopAnnotationIntrospector.instance; }
@Override public VisibilityChecker<?> getDefaultVisibilityChecker() { VisibilityChecker<?> vchecker = super.getDefaultVisibilityChecker(); if (!isEnabled(MapperFeature.AUTO_DETECT_SETTERS)) { vchecker = vchecker.withSetterVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_CREATORS)) { vchecker = vchecker.withCreatorVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_FIELDS)) { vchecker = vchecker.withFieldVisibility(Visibility.NONE); } return vchecker; }
/** * Method for constructing and returning a new instance with different * {@link AnnotationIntrospector} to use (replacing old one). *<p> * NOTE: make sure to register new instance with <code>ObjectMapper</code> * if directly calling this method. */ public final T with(AnnotationIntrospector ai) { return _withBase(_base.withAnnotationIntrospector(ai)); }
/** * In addition to constructing instance with specified date format, * will enable or disable <code>SerializationFeature.WRITE_DATES_AS_TIMESTAMPS</code> * (enable if format set as null; disable if non-null) */ @Override public SerializationConfig with(DateFormat df) { SerializationConfig cfg = super.with(df); // Also need to toggle this feature based on existence of date format: if (df == null) { return cfg.with(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); } return cfg.without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); }
public T withRootName(String rootName) { if (rootName == null) { return withRootName((PropertyName) null); } return withRootName(PropertyName.construct(rootName)); }
@Override public VisibilityChecker<?> getDefaultVisibilityChecker() { VisibilityChecker<?> vchecker = super.getDefaultVisibilityChecker(); // then global overrides (disabling) if (!isEnabled(MapperFeature.AUTO_DETECT_SETTERS)) { vchecker = vchecker.withSetterVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_CREATORS)) { vchecker = vchecker.withCreatorVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_GETTERS)) { vchecker = vchecker.withGetterVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_IS_GETTERS)) { vchecker = vchecker.withIsGetterVisibility(Visibility.NONE); } if (!isEnabled(MapperFeature.AUTO_DETECT_FIELDS)) { vchecker = vchecker.withFieldVisibility(Visibility.NONE); } return vchecker; }
/** * Fluent factory method that will construct and return a new configuration * object instance with specified features enabled. */ @SuppressWarnings("unchecked") @Override public final T with(MapperFeature... features) { int newMapperFlags = _mapperFeatures; for (MapperFeature f : features) { newMapperFlags |= f.getMask(); } if (newMapperFlags == _mapperFeatures) { return (T) this; } return _withMapperFeatures(newMapperFlags); }
/** * Method for constructing an instance that has only specified * attributes, removing any attributes that exist before the call. * * @since 2.3 */ public T withAttributes(Map<?,?> attributes) { return with(getAttributes().withSharedAttributes(attributes)); }
/** * Method for getting {@link AnnotationIntrospector} configured * to introspect annotation values used for configuration. */ @Override public AnnotationIntrospector getAnnotationIntrospector() { /* 29-Jul-2009, tatu: it's now possible to disable use of * annotations; can be done using "no-op" introspector */ if (isEnabled(MapperFeature.USE_ANNOTATIONS)) { return super.getAnnotationIntrospector(); } return NopAnnotationIntrospector.instance; }
@Override public final JsonIgnoreProperties.Value getDefaultPropertyIgnorals(Class<?> baseType, AnnotatedClass actualClass) { AnnotationIntrospector intr = getAnnotationIntrospector(); JsonIgnoreProperties.Value base = (intr == null) ? null : intr.findPropertyIgnorals(actualClass); JsonIgnoreProperties.Value overrides = getDefaultPropertyIgnorals(baseType); return JsonIgnoreProperties.Value.merge(base, overrides); }