|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fasterxml.jackson.jr.ob.impl.MapBuilder
public abstract class MapBuilder
Helper class that is used for constructing Map
s
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 List
s may be built.
Nested Class Summary | |
---|---|
static class |
MapBuilder.Default
Default MapBuilder implementation which builds
either HashMap or LinkedHashMap instances
(depending on JSON.Feature.PRESERVE_FIELD_ORDERING ). |
Field Summary | |
---|---|
protected int |
_features
|
protected Class<?> |
_mapType
Optional Map implementation class, used when specific
implementation is desired. |
Constructor Summary | |
---|---|
protected |
MapBuilder(int features,
Class<?> type)
|
Method Summary | |
---|---|
abstract Map<Object,Object> |
build()
|
static MapBuilder |
defaultImpl()
Factory method for getting a blueprint instance of the default MapBuilder implementation. |
Map<Object,Object> |
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. |
boolean |
isEnabled(JSON.Feature f)
|
MapBuilder |
newBuilder()
|
abstract MapBuilder |
newBuilder(Class<?> mapImpl)
|
abstract MapBuilder |
newBuilder(int features)
|
abstract MapBuilder |
put(Object key,
Object value)
|
Map<Object,Object> |
singletonMap(Object 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 MapBuilder |
start()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int _features
protected final Class<?> _mapType
Map
implementation class, used when specific
implementation is desired.
Constructor Detail |
---|
protected MapBuilder(int features, Class<?> type)
Method Detail |
---|
public static MapBuilder defaultImpl()
MapBuilder
implementation.
public abstract MapBuilder newBuilder(int features)
public abstract MapBuilder newBuilder(Class<?> mapImpl)
public MapBuilder newBuilder()
public final boolean isEnabled(JSON.Feature f)
public abstract MapBuilder start()
public abstract MapBuilder put(Object key, Object value)
public abstract Map<Object,Object> build()
public Map<Object,Object> emptyMap()
Default implementation simply calls:
start().build();which assumes that a builder has been constructed with
newBuilder(int)
public Map<Object,Object> singletonMap(Object key, Object value)
Default implementation simply calls:
start().put(key, value).build();
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |