net.sf.morph.transform.converters
Class ContainerToTraverserConverter
java.lang.Object
net.sf.morph.transform.transformers.BaseTransformer
net.sf.morph.transform.transformers.BaseReflectorTransformer
net.sf.morph.transform.converters.ContainerToTraverserConverter
- All Implemented Interfaces:
- net.sf.composite.Component, Converter, DecoratedConverter, DecoratedTransformer, ExplicitTransformer, Transformer
public class ContainerToTraverserConverter
- extends BaseReflectorTransformer
- implements DecoratedConverter
Converts an object to a traverser type (an Iterator or an Enumeration). If
the source object is reflectable as a container object by the reflector
of this
- Since:
- Dec 18, 2004
- Author:
- Matt Sgarlata
Methods inherited from class net.sf.morph.transform.transformers.BaseTransformer |
clone, convert, convert, copy, copy, copyImpl, createDefaultReflector, createNewInstance, createNewInstanceImpl, createReusableSource, equals, equals, equalsUnidirectionalTest, getDestinationClasses, getInstantiatingReflector, getLocale, getLog, getNestedTransformer, getReflector, getReflector, getSourceClasses, getTransformableCallCache, getTransformerName, initialize, initializeImpl, isAutomaticallyHandlingNulls, isCachingIsTransformableCalls, isImpreciseTransformation, isImpreciseTransformationImpl, isInitialized, isPerformingLogging, isTransformable, isTransformableImpl, isWrappingRuntimeExceptions, setCachingIsTransformableCalls, setDestinationClasses, setInitialized, setLog, setNestedTransformer, setReflector, setSourceClasses, setTransformableCallCache, setTransformerName, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ContainerToTraverserConverter
public ContainerToTraverserConverter()
convertImpl
protected java.lang.Object convertImpl(java.lang.Class destinationClass,
java.lang.Object source,
java.util.Locale locale)
throws java.lang.Exception
- The implementation of the
convert
method, which may omit
the invalid argument checks already performed by this base class. By
default, this method creates a new instance of the destinationClass and
copies information from the source to the destination. This
implementation should be fine as-is for Copiers, but Converters will need
to implement this method since they will not be implementing the copy
method.
- Overrides:
convertImpl
in class BaseTransformer
locale
- the locale in which the conversion should take place. for
converters that are not locale-aware, the local argument can
simply be ignored
- Throws:
java.lang.Exception
getSourceClassesImpl
protected java.lang.Class[] getSourceClassesImpl()
throws java.lang.Exception
Transformer.getSourceClasses()
implementation template method.
- Overrides:
getSourceClassesImpl
in class BaseReflectorTransformer
- Returns:
- Class[]
- Throws:
java.lang.Exception
getDestinationClassesImpl
protected java.lang.Class[] getDestinationClassesImpl()
throws java.lang.Exception
Transformer.getDestinationClasses()
implementation template method.
- Overrides:
getDestinationClassesImpl
in class BaseReflectorTransformer
- Returns:
- Class[]
- Throws:
java.lang.Exception
getTraverserConverter
public Converter getTraverserConverter()
- Get the traverser converter used by this ContainerToTraverserConverter.
- Returns:
- Converter
setTraverserConverter
public void setTraverserConverter(Converter traverserConverter)
- Set the traverser converter used by this ContainerToTraverserConverter.
- Parameters:
traverserConverter
-
Copyright © 2004-2008.