Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.jackson.databind.cfg;
  
  import java.util.Locale;
  import java.util.TimeZone;
  
Immutable container class used to store simple configuration settings. Since instances are fully immutable, instances can be freely shared and used without synchronization.
 
 public final class BaseSettings
     implements java.io.Serializable // since 2.1
 {
     // for 2.1.0:
     private static final long serialVersionUID = 4939673998947122190L;
 
     /*
     /**********************************************************
     /* Configuration settings; introspection, related
     /**********************************************************
      */
    
    
Introspector used to figure out Bean properties needed for bean serialization and deserialization. Overridable so that it is possible to change low-level details of introspection, like adding new annotation types.
 
     protected final ClassIntrospector _classIntrospector;

    
Introspector used for accessing annotation value based configuration.
 
     protected final AnnotationIntrospector _annotationIntrospector;

    
Object used for determining whether specific property elements (method, constructors, fields) can be auto-detected based on their visibility (access modifiers). Can be changed to allow different minimum visibility levels for auto-detection. Note that this is the global handler; individual types (classes) can further override active checker used (using com.fasterxml.jackson.annotation.JsonAutoDetect annotation)
 
     protected final VisibilityChecker<?> _visibilityChecker;

    
Custom property naming strategy in use, if any.
 
     protected final PropertyNamingStrategy _propertyNamingStrategy;

    
Specific factory used for creating com.fasterxml.jackson.databind.JavaType instances; needed to allow modules to add more custom type handling (mostly to support types of non-Java JVM languages)
 
     protected final TypeFactory _typeFactory;
 
     /*
     /**********************************************************
     /* Configuration settings; type resolution
     /**********************************************************
      */

    
Type information handler used for "untyped" values (ones declared to have type Object.class)
 
     protected final TypeResolverBuilder<?> _typeResolverBuilder;
     
     /*
     /**********************************************************
     /* Configuration settings; other
     /**********************************************************
      */
    
    
Custom date format to use for de-serialization. If specified, will be used instead of com.fasterxml.jackson.databind.util.StdDateFormat.

Note that the configured format object will be cloned once per deserialization process (first time it is needed)

 
     protected final DateFormat _dateFormat;

    
Object used for creating instances of handlers (serializers, deserializers, type and type id resolvers), given class to instantiate. This is typically used to do additional configuration (with dependency injection, for example) beyond simply construction of instances; or to use alternative constructors.
    protected final HandlerInstantiator _handlerInstantiator;

    
Default java.util.Locale used with serialization formats. Default value is java.util.Locale.getDefault().
    protected final Locale _locale;

    
Default java.util.TimeZone used with serialization formats. Default value is java.util.TimeZone.getDefault(), which is typically the local time zone (unless overridden for JVM).

Note that if a new value is set, time zone is also assigned to _dateFormat of this object.

    protected final TimeZone _timeZone;

    
Explicitly default com.fasterxml.jackson.core.Base64Variant to use for handling binary data (byte[]), used with data formats that use base64 encoding (like JSON, CSV).

Since:
2.1
    protected final Base64Variant _defaultBase64;
    
    /*
    /**********************************************************
    /* Construction
    /**********************************************************
     */
            VisibilityChecker<?> vcPropertyNamingStrategy pnsTypeFactory tf,
            TypeResolverBuilder<?> typerDateFormat dateFormatHandlerInstantiator hi,
            Locale localeTimeZone tzBase64Variant defaultBase64)
    {
         = ci;
         = ai;
         = vc;
         = pns;
         = tf;
         = typer;
         = dateFormat;
         = hi;
         = locale;
         = tz;
         = defaultBase64;
    }
    /*
    /**********************************************************
    /* Factory methods
    /**********************************************************
     */
    
        if ( == ci) {
            return this;
        }
                ,
                );
    }
    
        if ( == ai) {
            return this;
        }
                ,
                );
    }
        return withAnnotationIntrospector(AnnotationIntrospectorPair.create(ai));
    }
        return withAnnotationIntrospector(AnnotationIntrospectorPair.create(ai));
    }
    
        if ( == vc) {
            return this;
        }
                ,
                );
    }
    public BaseSettings withVisibility(PropertyAccessor forMethodJsonAutoDetect.Visibility visibility) {
                .withVisibility(forMethodvisibility),
                ,
                ,
                );
    }
    
        if ( == pns) {
            return this;
        }
                ,
                );
    }
        if ( == tf) {
            return this;
        }
                ,
                );
    }
        if ( == typer) {
            return this;
        }
                typer,
                );
    }
    
    public BaseSettings withDateFormat(DateFormat df) {
        if ( == df) {
            return this;
        }
                df,
                );
    }
        if ( == hi) {
            return this;
        }
                hi,
                );
    }
    public BaseSettings with(Locale l) {
        if ( == l) {
            return this;
        }
                l,
                );
    }

    
Fluent factory for constructing a new instance that uses specified TimeZone. Note that timezone used with also be assigned to configured java.text.DateFormat, changing time formatting defaults.
    public BaseSettings with(TimeZone tz)
    {
        if (tz == null) {
            throw new IllegalArgumentException();
        }
        DateFormat df = ;
        if (df instanceof StdDateFormat) {
            df = ((StdDateFormatdf).withTimeZone(tz);
        } else {
            // we don't know if original format might be shared; better create a clone:
            df = (DateFormatdf.clone();
            df.setTimeZone(tz);
        }
                ,
                df,
                tz);
    }

    

Since:
2.1
    public BaseSettings with(Base64Variant base64) {
        if (base64 == ) {
            return this;
        }
                ,
                ,
                base64);
    }
    
    /*
    /**********************************************************
    /* API
    /**********************************************************
     */
        return ;
    }
    
        return ;
    }
        return ;
    }
        return ;
    }
    public TypeFactory getTypeFactory() {
        return ;
    }
        return ;
    }
    
    public DateFormat getDateFormat() {
        return ;
    }
        return ;
    }
    public Locale getLocale() {
        return ;
    }
    public TimeZone getTimeZone() {
        return ;
    }
    public Base64Variant getBase64Variant() {
        return ;
    }
New to GrepCode? Check out our FAQ X