Package org.joda.beans.ser
Class CollectSerIteratorFactory
- java.lang.Object
-
- org.joda.beans.ser.SerIteratorFactory
-
- org.joda.beans.ser.GuavaSerIteratorFactory
-
- org.joda.beans.ser.CollectSerIteratorFactory
-
public class CollectSerIteratorFactory extends GuavaSerIteratorFactory
Factory used to create wrappers around collection-like objects.
-
-
Field Summary
-
Fields inherited from class org.joda.beans.ser.SerIteratorFactory
EMPTY_VALUE_TYPES, INSTANCE
-
-
Constructor Summary
Constructors Constructor Description CollectSerIteratorFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SerIterator
create(Object value, MetaProperty<?> prop, Class<?> beanClass)
Creates an iterator wrapper for a meta-property value.SerIterator
createChild(Object value, SerIterator parent)
Creates an iterator wrapper for a value retrieved from a parent iterator.SerIterable
createIterable(String metaTypeDescription, JodaBeanSer settings, Map<String,Class<?>> knownTypes)
Creates an iterator wrapper for a meta-property value.SerIterable
createIterable(MetaProperty<?> prop, Class<?> beanClass)
Creates an iterator wrapper for a meta-property value.static SerIterable
grid(Class<?> valueType, List<Class<?>> valueTypeTypes)
Gets an iterable wrapper forGrid
.static SerIterator
grid(org.joda.collect.grid.Grid<?> grid, Class<?> declaredType, Class<?> valueType, List<Class<?>> valueTypeTypes)
Gets an iterator wrapper forGrid
.-
Methods inherited from class org.joda.beans.ser.GuavaSerIteratorFactory
biMap, biMap, immutableList, immutableSet, immutableSortedSet, listMultimap, multimap, multiset, multiset, setMultimap, sortedMultiset, table, table
-
Methods inherited from class org.joda.beans.ser.SerIteratorFactory
array, array, collection, create, createIterable, createIterable, defaultToObjectClass, list, map, map, navigableMap, navigableSet, set, sortedMap, sortedSet
-
-
-
-
Method Detail
-
create
public SerIterator create(Object value, MetaProperty<?> prop, Class<?> beanClass)
Creates an iterator wrapper for a meta-property value.- Overrides:
create
in classGuavaSerIteratorFactory
- Parameters:
value
- the possible collection-like object, not nullprop
- the meta-property defining the value, not nullbeanClass
- the class of the bean, not the meta-property, for better generics, not null- Returns:
- the iterator, null if not a collection-like type
-
createChild
public SerIterator createChild(Object value, SerIterator parent)
Creates an iterator wrapper for a value retrieved from a parent iterator.Allows the parent iterator to define the child iterator using generic type information. This handles cases such as a
List
as the value in aMap
.- Overrides:
createChild
in classGuavaSerIteratorFactory
- Parameters:
value
- the possible collection-like object, not nullparent
- the parent iterator, not null- Returns:
- the iterator, null if not a collection-like type
-
createIterable
public SerIterable createIterable(String metaTypeDescription, JodaBeanSer settings, Map<String,Class<?>> knownTypes)
Creates an iterator wrapper for a meta-property value.- Overrides:
createIterable
in classGuavaSerIteratorFactory
- Parameters:
metaTypeDescription
- the description of the collection type, not nullsettings
- the settings object, not nullknownTypes
- the known types map, null if not using known type shortening- Returns:
- the iterator, null if not a collection-like type
-
createIterable
public SerIterable createIterable(MetaProperty<?> prop, Class<?> beanClass)
Creates an iterator wrapper for a meta-property value.- Overrides:
createIterable
in classGuavaSerIteratorFactory
- Parameters:
prop
- the meta-property defining the value, not nullbeanClass
- the class of the bean, not the meta-property, for better generics, not null- Returns:
- the iterator, null if not a collection-like type
-
grid
public static final SerIterable grid(Class<?> valueType, List<Class<?>> valueTypeTypes)
Gets an iterable wrapper forGrid
.- Parameters:
valueType
- the value type, not nullvalueTypeTypes
- the generic parameters of the value type- Returns:
- the iterable, not null
-
grid
public static final SerIterator grid(org.joda.collect.grid.Grid<?> grid, Class<?> declaredType, Class<?> valueType, List<Class<?>> valueTypeTypes)
Gets an iterator wrapper forGrid
.- Parameters:
grid
- the collection, not nulldeclaredType
- the declared type, not nullvalueType
- the value type, not nullvalueTypeTypes
- the generic parameters of the value type- Returns:
- the iterator, not null
-
-