|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joda.beans.ser.SerIteratorFactory
public class SerIteratorFactory
A factory used to create wrappers around collection-like objects.
| Field Summary | |
|---|---|
static List<Class<?>> |
EMPTY_VALUE_TYPES
An empty list of classes. |
static SerIteratorFactory |
INSTANCE
Singleton instance. |
| Constructor Summary | |
|---|---|
SerIteratorFactory()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SerIteratorFactory INSTANCE
public static final List<Class<?>> EMPTY_VALUE_TYPES
| Constructor Detail |
|---|
public SerIteratorFactory()
| Method Detail |
|---|
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 null
public 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 null
protected Class<?> defaultToObjectClass(Class<?> type)
type - the type, may be null
public 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 shortening
public SerIterable createIterable(SerIterable iterable)
iterable - the parent iterable, not null
public 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 null
public static final SerIterable list(Class<?> valueType,
List<Class<?>> valueTypeTypes)
List.
valueType - the value type, not nullvalueTypeTypes - the generic parameters of the value type
public static final SerIterable set(Class<?> valueType,
List<Class<?>> valueTypeTypes)
Set.
valueType - the value type, not nullvalueTypeTypes - the generic parameters of the value type
public static final SerIterable sortedSet(Class<?> valueType,
List<Class<?>> valueTypeTypes)
SortedSet.
valueType - the value type, not nullvalueTypeTypes - the generic parameters of the value type
public static final SerIterable navigableSet(Class<?> valueType,
List<Class<?>> valueTypeTypes)
NavigableSet.
valueType - the value type, not nullvalueTypeTypes - the generic parameters of the value type
public 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 type
public 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 type
public 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 type
public 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 type
public 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 type
public static final SerIterable array(Class<?> valueType)
valueType - the value type, not null
public static final SerIterator array(Object[] array,
Class<?> declaredType,
Class<?> valueType)
array - the array, not nulldeclaredType - the declared type, not nullvalueType - the value type, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||