/** * Accessor for getting a mutable configuration override object for * given type, needed to add or change per-type overrides applied * to properties of given type. * Usage is through returned object by colling "setter" methods, which * directly modify override object and take effect directly. * For example you can do *<pre> * mapper.configOverride(java.util.Date.class) * .setFormat(JsonFormat.Value.forPattern("yyyy-MM-dd")); *<pre> * to change the default format to use for properties of type * {@link java.util.Date} (possibly further overridden by per-property * annotations) * * @since 2.8 */ public MutableConfigOverride configOverride(Class<?> type) { return _configOverrides.findOrCreateOverride(type); }
/** * Accessor for getting a mutable configuration override object for * given type, needed to add or change per-type overrides applied * to properties of given type. * Usage is through returned object by colling "setter" methods, which * directly modify override object and take effect directly. * For example you can do *<pre> * mapper.configOverride(java.util.Date.class) * .setFormat(JsonFormat.Value.forPattern("yyyy-MM-dd")); *<pre> * to change the default format to use for properties of type * {@link java.util.Date} (possibly further overridden by per-property * annotations) * * @since 2.8 */ public MutableConfigOverride configOverride(Class<?> type) { return _configOverrides.findOrCreateOverride(type); }
/** * Accessor for getting a mutable configuration override object for * given type, needed to add or change per-type overrides applied * to properties of given type. * Usage is through returned object by colling "setter" methods, which * directly modify override object and take effect directly. * For example you can do *<pre> * mapper.configOverride(java.util.Date.class) * .setFormat(JsonFormat.Value.forPattern("yyyy-MM-dd")); *<pre> * to change the default format to use for properties of type * {@link java.util.Date} (possibly further overridden by per-property * annotations) * * @since 2.8 */ public MutableConfigOverride configOverride(Class<?> type) { return _propertyOverrides.findOrCreateOverride(type); }
public Builder(XmlFactory f) { super(f); // 21-Jun-2017, tatu: Seems like there are many cases in XML where ability to coerce empty // String into `null` (where it otherwise is an error) is very useful. enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); _defaultUseWrapper = JacksonXmlAnnotationIntrospector.DEFAULT_USE_WRAPPER; _nameForTextElement = FromXmlParser.DEFAULT_UNNAMED_TEXT_PROPERTY; // as well as AnnotationIntrospector: note, however, that "use wrapper" may well // change later on annotationIntrospector(new JacksonXmlAnnotationIntrospector(_defaultUseWrapper)); // Need to mangle Type Ids (to avoid invalid XML Name characters); one way is this: typeResolverProvider(new XmlTypeResolverProvider()); // Some changes easiest to apply via Module addModule(new XmlModule()); // 04-May-2018, tatu: Important! Let's also default `String` `null` handling to coerce // to empty string -- this lets us induce `null` from empty tags first _configOverrides.findOrCreateOverride(String.class) .setNullHandling(JsonSetter.Value.forValueNulls(Nulls.AS_EMPTY)); }