1 package com.fasterxml.jackson.databind.cfg;
2 
3 import com.fasterxml.jackson.annotation.JsonAutoDetect;
4 import com.fasterxml.jackson.annotation.JsonFormat;
5 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6 import com.fasterxml.jackson.annotation.JsonInclude;
7 import com.fasterxml.jackson.annotation.JsonSetter;
8 
9 /**
10  * Extension of {@link ConfigOverride} that allows changing of
11  * contained configuration settings. Exposed to
12  * {@link com.fasterxml.jackson.databind.Module}s that want to set
13  * overrides, but not exposed to functionality that wants to apply
14  * overrides.
15  *
16  * @since 2.8
17  */
18 public class MutableConfigOverride
19     extends ConfigOverride
20     implements java.io.Serializable
21 {
22     private static final long serialVersionUID = 1L;
23 
MutableConfigOverride()24     public MutableConfigOverride() { super(); }
25 
MutableConfigOverride(MutableConfigOverride src)26     protected MutableConfigOverride(MutableConfigOverride src) {
27         super(src);
28     }
29 
copy()30     public MutableConfigOverride copy() {
31         return new MutableConfigOverride(this);
32     }
33 
setFormat(JsonFormat.Value v)34     public MutableConfigOverride setFormat(JsonFormat.Value v) {
35         _format = v;
36         return this;
37     }
38 
39     /**
40      * Override inclusion setting for all properties contained in POJOs of the
41      * associated type.
42      *
43      * @param v Inclusion setting to apply contained properties.
44      */
setInclude(JsonInclude.Value v)45     public MutableConfigOverride setInclude(JsonInclude.Value v) {
46         _include = v;
47         return this;
48     }
49 
50     /**
51      * Override inclusion setting for properties of the associated type
52      * regardless of the type of the POJO containing it.
53      *
54      * @param v Inclusion setting to apply for properties of associated type.
55      *
56      * @since 2.9
57      */
setIncludeAsProperty(JsonInclude.Value v)58     public MutableConfigOverride setIncludeAsProperty(JsonInclude.Value v) {
59         _includeAsProperty = v;
60         return this;
61     }
62 
setIgnorals(JsonIgnoreProperties.Value v)63     public MutableConfigOverride setIgnorals(JsonIgnoreProperties.Value v) {
64         _ignorals = v;
65         return this;
66     }
67 
setIsIgnoredType(Boolean v)68     public MutableConfigOverride setIsIgnoredType(Boolean v) {
69         _isIgnoredType = v;
70         return this;
71     }
72 
73     /**
74      * @since 2.9
75      */
setSetterInfo(JsonSetter.Value v)76     public MutableConfigOverride setSetterInfo(JsonSetter.Value v) {
77         _setterInfo = v;
78         return this;
79     }
80 
81     /**
82      * @since 2.9
83      */
setVisibility(JsonAutoDetect.Value v)84     public MutableConfigOverride setVisibility(JsonAutoDetect.Value v) {
85         _visibility = v;
86         return this;
87     }
88 
89     /**
90      * @since 2.9
91      */
setMergeable(Boolean v)92     public MutableConfigOverride setMergeable(Boolean v) {
93         _mergeable = v;
94         return this;
95     }
96 }
97