public BaseSettings withClassIntrospector(ClassIntrospector ci) { if (_classIntrospector == ci) { return this; } return new BaseSettings(ci, _annotationIntrospector, _propertyNamingStrategy, _typeFactory, _typeResolverBuilder, _dateFormat, _handlerInstantiator, _locale, _timeZone, _defaultBase64); }
/** * Method for constructing and returning a new instance with different * {@link ClassIntrospector} * to use. *<p> * NOTE: make sure to register new instance with <code>ObjectMapper</code> * if directly calling this method. */ public final T with(ClassIntrospector ci) { return _withBase(_base.withClassIntrospector(ci)); }
/** * Method for getting {@link AnnotationIntrospector} configured * to introspect annotation values used for configuration. *<p> * Non-final since it is actually overridden by sub-classes (for now?) */ public AnnotationIntrospector getAnnotationIntrospector() { if (isEnabled(MapperFeature.USE_ANNOTATIONS)) { return _base.getAnnotationIntrospector(); } return NopAnnotationIntrospector.instance; }
public BaseSettings withDateFormat(DateFormat df) { if (_dateFormat == df) { return this; } // 26-Sep-2015, tatu: Related to [databind#939], let's try to force TimeZone if // (but only if!) it has been set explicitly. if ((df != null) && hasExplicitTimeZone()) { df = _force(df, _timeZone); } return new BaseSettings(_classIntrospector, _annotationIntrospector, _propertyNamingStrategy, _typeFactory, _typeResolverBuilder, df, _handlerInstantiator, _locale, _timeZone, _defaultBase64); }
/** * Fluent factory for constructing a new instance that uses specified TimeZone. * Note that timezone used with also be assigned to configured {@link DateFormat}, * changing time formatting defaults. */ public BaseSettings with(TimeZone tz) { if (tz == null) { throw new IllegalArgumentException(); } if (tz == _timeZone) { return this; } DateFormat df = _force(_dateFormat, tz); return new BaseSettings(_classIntrospector, _annotationIntrospector, _propertyNamingStrategy, _typeFactory, _typeResolverBuilder, df, _handlerInstantiator, _locale, tz, _defaultBase64); }
private static SerializationConfig getSerializationConfig() { SimpleMixInResolver mixins = new SimpleMixInResolver(null); BaseSettings DEFAULT_BASE = new BaseSettings( null, // cannot share global ClassIntrospector any more (2.5+) new JacksonAnnotationIntrospector(), null, TypeFactory.defaultInstance(), null, StdDateFormat.instance, null, Locale.getDefault(), null, // to indicate "use Jackson default TimeZone" (UTC since Jackson 2.7) Base64Variants.getDefaultVariant() // 2.1 ); BaseSettings base = DEFAULT_BASE.withClassIntrospector(new BasicClassIntrospector()); return new SerializationConfig(base, new StdSubtypeResolver(), mixins, new RootNameLookup(), new ConfigOverrides()); }
/** * Method for accessing the default {@link java.util.Locale} to use * for formatting, unless overridden by local annotations. * Initially set to {@link Locale#getDefault()}. */ public final Locale getLocale() { return _base.getLocale(); }
/** * Method for accessing the default {@link java.util.TimeZone} to use * for formatting, unless overridden by local annotations. * Initially set to {@link TimeZone#getDefault()}. */ public final TimeZone getTimeZone() { return _base.getTimeZone(); }
public final TypeFactory getTypeFactory() { return _base.getTypeFactory(); }
public final PropertyNamingStrategy getPropertyNamingStrategy() { return _base.getPropertyNamingStrategy(); }
public ClassIntrospector getClassIntrospector() { return _base.getClassIntrospector(); }
public final HandlerInstantiator getHandlerInstantiator() { return _base.getHandlerInstantiator(); }
/** * Method for accessing currently configured (textual) date format * that will be used for reading or writing date values (in case * of writing, only if textual output is configured; not if dates * are to be serialized as time stamps). *<p> * Note that typically {@link DateFormat} instances are <b>not thread-safe</b> * (at least ones provided by JDK): * this means that calling code should clone format instance before * using it. *<p> * This method is usually only called by framework itself, since there * are convenience methods available via * {@link DeserializationContext} and {@link SerializerProvider} that * take care of cloning and thread-safe reuse. */ public final DateFormat getDateFormat() { return _base.getDateFormat(); }
private static SerializationConfig getSerializationConfig() { SimpleMixInResolver mixins = new SimpleMixInResolver(null); BaseSettings DEFAULT_BASE = new BaseSettings( null, // cannot share global ClassIntrospector any more (2.5+) new JacksonAnnotationIntrospector(), null, TypeFactory.defaultInstance(), null, StdDateFormat.instance, null, Locale.getDefault(), null, // to indicate "use Jackson default TimeZone" (UTC since Jackson 2.7) Base64Variants.getDefaultVariant() // 2.1 ); BaseSettings base = DEFAULT_BASE.withClassIntrospector(new BasicClassIntrospector()); return new SerializationConfig(base, new StdSubtypeResolver(), mixins, new RootNameLookup(), new ConfigOverrides()); }
/** * Method for accessing the default {@link java.util.Locale} to use * for formatting, unless overridden by local annotations. * Initially set to {@link Locale#getDefault()}. */ public final Locale getLocale() { return _base.getLocale(); }
/** * Method for accessing the default {@link java.util.TimeZone} to use * for formatting, unless overridden by local annotations. * Initially set to {@link TimeZone#getDefault()}. */ public final TimeZone getTimeZone() { return _base.getTimeZone(); }
public final TypeFactory getTypeFactory() { return _base.getTypeFactory(); }
public final PropertyNamingStrategy getPropertyNamingStrategy() { return _base.getPropertyNamingStrategy(); }
public ClassIntrospector getClassIntrospector() { return _base.getClassIntrospector(); }
public final HandlerInstantiator getHandlerInstantiator() { return _base.getHandlerInstantiator(); }