com.fasterxml.jackson.jr.ob.impl
Class CollectionBuilder.Default
java.lang.Object
com.fasterxml.jackson.jr.ob.impl.CollectionBuilder
com.fasterxml.jackson.jr.ob.impl.CollectionBuilder.Default
- Enclosing class:
- CollectionBuilder
public static class CollectionBuilder.Default
- extends CollectionBuilder
Default CollectionBuilder
implementation, which uses ArrayList
as the type of List
to build, unless instructed otherwise.
When sub-classing to use different underlying mutable List
type, you need to sub-class following methods:
If constructing builders that use different approaches (like, say, produce
immutable Guava Lists), you may need to override more methods; or perhaps
just extend basic CollectionBuilder
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_current
protected Collection<Object> _current
CollectionBuilder.Default
protected CollectionBuilder.Default(int features,
Class<?> collImpl)
newBuilder
public CollectionBuilder newBuilder(int features)
- Specified by:
newBuilder
in class CollectionBuilder
newBuilder
public CollectionBuilder newBuilder(Class<?> collType)
- Specified by:
newBuilder
in class CollectionBuilder
start
public CollectionBuilder start()
- Specified by:
start
in class CollectionBuilder
buildCollection
public Collection<Object> buildCollection()
- Description copied from class:
CollectionBuilder
- The usual build method to use for constructing
Collection
- Specified by:
buildCollection
in class CollectionBuilder
buildArray
public Object[] buildArray()
- Description copied from class:
CollectionBuilder
- Alternative build method used when desired result type is
Object[]
- Overrides:
buildArray
in class CollectionBuilder
add
public CollectionBuilder add(Object value)
- Specified by:
add
in class CollectionBuilder
emptyCollection
public Collection<Object> emptyCollection()
- Description copied from class:
CollectionBuilder
- 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.
Default implementation simply calls:
start().buildCollection();
- Overrides:
emptyCollection
in class CollectionBuilder
_list
protected Collection<Object> _list(int initialSize)
- Overridable factory method for constructing underlying List.
Copyright © 2016 FasterXML. All rights reserved.