|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fasterxml.jackson.jr.ob.impl.CollectionBuilder
public abstract class CollectionBuilder
Helper class that is used for constructing Collection
s
to map JSON Array 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 Collection
s may be built.
Nested Class Summary | |
---|---|
static class |
CollectionBuilder.Default
Default CollectionBuilder implementation, which uses ArrayList
as the type of List to build, unless instructed otherwise. |
Field Summary | |
---|---|
protected Class<?> |
_collectionType
Optional Collection implementation class, used when specific
implementation is desired. |
protected int |
_features
|
protected static Object[] |
EMPTY_ARRAY
|
Constructor Summary | |
---|---|
protected |
CollectionBuilder(int features,
Class<?> collImpl)
|
Method Summary | ||
---|---|---|
abstract CollectionBuilder |
add(Object value)
|
|
Object[] |
buildArray()
Alternative build method used when desired result type is Object[] |
|
|
buildArray(Class<T> type)
|
|
abstract Collection<Object> |
buildCollection()
The usual build method to use for constructing Collection |
|
static CollectionBuilder |
defaultImpl()
Factory method for getting a blueprint instance of the default CollectionBuilder implementation. |
|
Object[] |
emptyArray()
Specialized method that is called when an empty Object[] needs to
be returned. |
|
|
emptyArray(Class<T> type)
|
|
Collection<Object> |
emptyCollection()
Specialized method that is called when an empty Collection needs to be constructed; this may be a new Collection, or an immutable shared one, depending on implementation. |
|
boolean |
isEnabled(JSON.Feature f)
|
|
CollectionBuilder |
newBuilder()
|
|
abstract CollectionBuilder |
newBuilder(Class<?> collImpl)
|
|
abstract CollectionBuilder |
newBuilder(int features)
|
|
|
singletonArray(Class<T> type,
T value)
|
|
Object[] |
singletonArray(Object value)
Specialized method that is called when a single-entry array needs to be constructed. |
|
Collection<Object> |
singletonCollection(Object value)
Specialized method that is called when a single-entry Collection needs to be constructed. |
|
abstract CollectionBuilder |
start()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Object[] EMPTY_ARRAY
protected final int _features
protected final Class<?> _collectionType
Collection
implementation class, used when specific
implementation is desired.
Constructor Detail |
---|
protected CollectionBuilder(int features, Class<?> collImpl)
Method Detail |
---|
public static CollectionBuilder defaultImpl()
CollectionBuilder
implementation.
public abstract CollectionBuilder newBuilder(int features)
public abstract CollectionBuilder newBuilder(Class<?> collImpl)
public CollectionBuilder newBuilder()
public final boolean isEnabled(JSON.Feature f)
public abstract CollectionBuilder start()
public abstract CollectionBuilder add(Object value)
public abstract Collection<Object> buildCollection()
Collection
public Object[] buildArray()
Object[]
public <T> T[] buildArray(Class<T> type)
public Collection<Object> emptyCollection()
Default implementation simply calls:
start().buildCollection();
public Object[] emptyArray()
Object[]
needs to
be returned.
Default implementation simply returns a shared empty array instance.
public <T> T[] emptyArray(Class<T> type)
public Collection<Object> singletonCollection(Object value)
Default implementation simply calls:
start().add(value).buildCollection();
public Object[] singletonArray(Object value)
Default implementation simply returns equivalent of:
new Object[] { value }
public <T> T[] singletonArray(Class<T> type, T value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |