public class SerIteratorFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static List<Class<?>> |
EMPTY_VALUE_TYPES
An empty list of classes.
|
static SerIteratorFactory |
INSTANCE
Singleton instance.
|
| Constructor and Description |
|---|
SerIteratorFactory() |
| Modifier and Type | Method and Description |
|---|---|
static SerIterable |
array(Class<?> valueType)
Gets an iterable wrapper for an array.
|
static SerIterator |
array(Object[] array,
Class<?> declaredType,
Class<?> valueType)
Gets an iterator wrapper for an array.
|
static SerIterator |
collection(Collection<?> coll,
Class<?> declaredType,
Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterator wrapper for
Collection. |
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(MetaProperty<?> prop,
Class<?> beanClass)
Creates an iterator wrapper for a meta-property value.
|
SerIterable |
createIterable(SerIterable iterable)
Creates an iterator wrapper for a child where there are second level generic parameters.
|
SerIterable |
createIterable(String metaTypeDescription,
JodaBeanSer settings,
Map<String,Class<?>> knownTypes)
Creates an iterator wrapper for a meta-type description.
|
protected Class<?> |
defaultToObjectClass(Class<?> type)
Defaults input class to Object class.
|
static SerIterable |
list(Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for
List. |
static SerIterable |
map(Class<?> keyType,
Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for
Map. |
static SerIterator |
map(Map<?,?> map,
Class<?> declaredType,
Class<?> keyType,
Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterator wrapper for
Map. |
static SerIterable |
navigableMap(Class<?> keyType,
Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for
NavigableMap. |
static SerIterable |
navigableSet(Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for
NavigableSet. |
static SerIterable |
set(Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for
Set. |
static SerIterable |
sortedMap(Class<?> keyType,
Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for
SortedMap. |
static SerIterable |
sortedSet(Class<?> valueType,
List<Class<?>> valueTypeTypes)
Gets an iterable wrapper for
SortedSet. |
public static final SerIteratorFactory INSTANCE
public SerIterator create(Object value, MetaProperty<?> prop, Class<?> beanClass)
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 nullpublic SerIterator createChild(Object value, SerIterator parent)
Allows the parent iterator to define the child iterator using generic type information.
This handles cases such as a List as the value in a Map.
value - the possible collection-like object, not nullparent - the parent iterator, not nullprotected Class<?> defaultToObjectClass(Class<?> type)
type - the type, may be nullpublic SerIterable createIterable(String metaTypeDescription, JodaBeanSer settings, Map<String,Class<?>> knownTypes)
metaTypeDescription - the description of the collection type, not nullsettings - the settings object, not nullknownTypes - the known types map, null if not using known type shorteningpublic SerIterable createIterable(SerIterable iterable)
iterable - the parent iterable, not nullpublic SerIterable createIterable(MetaProperty<?> prop, Class<?> beanClass)
prop - the meta-property defining the value, not nullbeanClass - the class of the bean, not the meta-property, for better generics, not nullpublic static final SerIterable list(Class<?> valueType, List<Class<?>> valueTypeTypes)
List.valueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterable set(Class<?> valueType, List<Class<?>> valueTypeTypes)
Set.valueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterable sortedSet(Class<?> valueType, List<Class<?>> valueTypeTypes)
SortedSet.valueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterable navigableSet(Class<?> valueType, List<Class<?>> valueTypeTypes)
NavigableSet.valueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterator collection(Collection<?> coll, Class<?> declaredType, Class<?> valueType, List<Class<?>> valueTypeTypes)
Collection.coll - the collection, not nulldeclaredType - the declared type, not nullvalueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterable map(Class<?> keyType, Class<?> valueType, List<Class<?>> valueTypeTypes)
Map.keyType - the value type, not nullvalueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterable sortedMap(Class<?> keyType, Class<?> valueType, List<Class<?>> valueTypeTypes)
SortedMap.keyType - the value type, not nullvalueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterable navigableMap(Class<?> keyType, Class<?> valueType, List<Class<?>> valueTypeTypes)
NavigableMap.keyType - the value type, not nullvalueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterator map(Map<?,?> map, Class<?> declaredType, Class<?> keyType, Class<?> valueType, List<Class<?>> valueTypeTypes)
Map.map - the collection, not nulldeclaredType - the declared type, not nullkeyType - the value type, not nullvalueType - the value type, not nullvalueTypeTypes - the generic parameters of the value typepublic static final SerIterable array(Class<?> valueType)
valueType - the value type, not nullpublic static final SerIterator array(Object[] array, Class<?> declaredType, Class<?> valueType)
array - the array, not nulldeclaredType - the declared type, not nullvalueType - the value type, not nullCopyright © 2007–2017 Joda.org. All rights reserved.