net.sf.mmm.util.value.impl
Class AbstractConverterToArray<ARRAY>
java.lang.Object
net.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
net.sf.mmm.util.value.base.AbstractValueConverter<SOURCE,TARGET>
net.sf.mmm.util.value.base.AbstractRecursiveValueConverter<Object,CONTAINER>
net.sf.mmm.util.value.impl.AbstractValueConverterToContainer<ARRAY>
net.sf.mmm.util.value.impl.AbstractConverterToArray<ARRAY>
- Type Parameters:
ARRAY
- is the generic type of the array as target-type
.
- All Implemented Interfaces:
- SimpleValueConverter<Object,ARRAY>, ValueConverter<Object,ARRAY>
- Direct Known Subclasses:
- ValueConverterToArrayOfBoolean, ValueConverterToArrayOfByte, ValueConverterToArrayOfDouble, ValueConverterToArrayOfFloat, ValueConverterToArrayOfInt, ValueConverterToArrayOfLong, ValueConverterToArrayOfObject, ValueConverterToArrayOfShort
public abstract class AbstractConverterToArray<ARRAY>
- extends AbstractValueConverterToContainer<ARRAY>
This is an implementation of the
ValueConverter
interface that converts an
Object
to an array.
Java has a string type-system and arrays of primitive types (int[], etc.) can
therefore NOT be casted to Object[]. However Object is NOT specific enough so
we need to supply multiple ValueConverter
- Since:
- 1.1.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractConverterToArray
public AbstractConverterToArray()
- The constructor.
doInitialize
protected void doInitialize()
- This method performs the actual
initialization
. It is
called when AbstractComponent.initialize()
is invoked for the first time.
ATTENTION:
When you override this method from a sub-class you need to do a
super.AbstractComponent.doInitialize()
.
- Overrides:
doInitialize
in class AbstractValueConverterToContainer<ARRAY>
convertContainerEntry
protected void convertContainerEntry(Object element,
int index,
ARRAY container,
Object valueSource,
GenericType<? extends ARRAY> targetType,
Object value)
- Description copied from class:
AbstractValueConverterToContainer
- This method converts a single entry of a container.
- Specified by:
convertContainerEntry
in class AbstractValueConverterToContainer<ARRAY>
- Parameters:
element
- is the single entry (element) of the container to convert.index
- is the index of the given element
in the order of
occurrence.container
- is the current container where to add the given
element
as entry.valueSource
- describes the source of the value or null
if NOT available.targetType
- is the target-type
to convert
to.value
- is the original value to convert.
createContainer
protected ARRAY createContainer(GenericType<? extends ARRAY> targetType,
int length)
- This method creates the according container for the given
containerType
.
- Specified by:
createContainer
in class AbstractValueConverterToContainer<ARRAY>
- Parameters:
targetType
- is the GenericType
of the container.length
- is the length (or capacity) of the container to create.
- Returns:
- the container instance.
Copyright © 2001-2010 mmm-Team. All Rights Reserved.