Class CollectSerIteratorFactory


  • public class CollectSerIteratorFactory
    extends GuavaSerIteratorFactory
    Factory used to create wrappers around collection-like objects.
    • Constructor Detail

      • CollectSerIteratorFactory

        public CollectSerIteratorFactory()
    • Method Detail

      • create

        public SerIterator create​(Object value,
                                  MetaProperty<?> prop,
                                  Class<?> beanClass)
        Creates an iterator wrapper for a meta-property value.
        Overrides:
        create in class GuavaSerIteratorFactory
        Parameters:
        value - the possible collection-like object, not null
        prop - the meta-property defining the value, not null
        beanClass - 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 a Map.

        Overrides:
        createChild in class GuavaSerIteratorFactory
        Parameters:
        value - the possible collection-like object, not null
        parent - 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 class GuavaSerIteratorFactory
        Parameters:
        metaTypeDescription - the description of the collection type, not null
        settings - the settings object, not null
        knownTypes - 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 class GuavaSerIteratorFactory
        Parameters:
        prop - the meta-property defining the value, not null
        beanClass - 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 for Grid.
        Parameters:
        valueType - the value type, not null
        valueTypeTypes - 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 for Grid.
        Parameters:
        grid - the collection, not null
        declaredType - the declared type, not null
        valueType - the value type, not null
        valueTypeTypes - the generic parameters of the value type
        Returns:
        the iterator, not null