Package com.fasterxml.jackson.jr.ob.api
Class MapBuilder
java.lang.Object
com.fasterxml.jackson.jr.ob.api.MapBuilder
- Direct Known Subclasses:
MapBuilder.Default
Helper class that is used for constructing
Maps
to map JSON Object values in.
Objects server both as "factories" for creating new builders (blueprint
style), and as actual builders. For each distinct read operation,
newBuilder(int) will be called at least once; this instance
may be used and reused multiple times, as calling start()
will reset the state so that more Lists may be built.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefaultMapBuilderimplementation which builds eitherHashMaporLinkedHashMapinstances (depending onJSON.Feature.PRESERVE_FIELD_ORDERING). -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()static MapBuilderFactory method for getting a blueprint instance of the defaultMapBuilderimplementation.emptyMap()Specialized method that is called when an empty list needs to be constructed; this may be a new list, or an immutable shared List, depending on implementation.final booleanabstract MapBuildernewBuilder(int features) abstract MapBuildernewBuilder(Class<?> mapImpl) abstract MapBuildersingletonMap(String key, Object value) Specialized method that is called when an empty list needs to be constructed; this may be a new list, or an immutable shared List, depending on implementation.abstract MapBuilderstart()
-
Field Details
-
_features
protected final int _features -
_checkDups
protected final boolean _checkDups -
_mapType
OptionalMapimplementation class, used when specific implementation is desired.
-
-
Constructor Details
-
MapBuilder
-
-
Method Details
-
defaultImpl
Factory method for getting a blueprint instance of the defaultMapBuilderimplementation. -
newBuilder
-
newBuilder
-
newBuilder
-
isEnabled
-
start
-
put
-
build
-
emptyMap
Specialized method that is called when an empty list needs to be constructed; this may be a new list, or an immutable shared List, depending on implementation.Default implementation simply calls:
start().build();
which assumes that a builder has been constructed withnewBuilder(int)- Throws:
JSONObjectException
-
singletonMap
Specialized method that is called when an empty list needs to be constructed; this may be a new list, or an immutable shared List, depending on implementation.Default implementation simply calls:
start().put(key, value).build();
- Throws:
JSONObjectException
-