Skip to content

Commit

Permalink
Start work on #3036
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 1, 2021
1 parent 02ecda9 commit b2b6105
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.security.PrivilegedAction;
import java.text.DateFormat;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.UnaryOperator;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down Expand Up @@ -232,6 +234,44 @@ public B configure(StreamWriteFeature feature, boolean state) {
return _this();
}

/*
/**********************************************************************
/* Changing settings, config overrides
/**********************************************************************
*/

/**
* Method for changing config overrides for specific type, through
* callback to specific handler.
*
* @param forType Type to change config overrides for
* @param handler Function to call with {@link MutableConfigOverride}
*
* @since 2.13
*/
public B withConfigOverride(Class<?> forType,
Consumer<MutableConfigOverride> handler)
{
handler.accept(_mapper.configOverride(forType));
return _this();
}

// Not possible to support these in 2.x, yet (added in 3.0); would require
// access to "ConfigOverrides" that `ObjectMapper` holds

// public B withAllConfigOverrides(Consumer<ConfigOverrides> handler)
// public B changeDefaultVisibility(UnaryOperator<VisibilityChecker> handler)
// public B changeDefaultPropertyInclusion(UnaryOperator<JsonInclude.Value> handler)
// public B changeDefaultNullHandling(UnaryOperator<JsonSetter.Value> handler)
// public B defaultMergeable(Boolean b)
// public B defaultLeniency(Boolean b)

/*
/**********************************************************************
/* Changing settings, coercion config
/**********************************************************************
*/

/*
/**********************************************************************
/* Module registration, discovery, access
Expand Down

0 comments on commit b2b6105

Please sign in to comment.