net.sf.morph.transform.copiers
Class AssemblyCopierSupport

java.lang.Object
  extended by net.sf.morph.transform.transformers.BaseTransformer
      extended by net.sf.morph.transform.transformers.BaseCompositeTransformer
          extended by net.sf.morph.transform.copiers.AssemblyCopierSupport
All Implemented Interfaces:
net.sf.composite.Component, net.sf.composite.Composite, net.sf.composite.SimpleComposite, net.sf.composite.StrictlyTypedComposite, DecoratedTransformer, ExplicitTransformer, Transformer
Direct Known Subclasses:
AssemblerCopier, DisassemblerCopier

public abstract class AssemblyCopierSupport
extends BaseCompositeTransformer

Support for AssemblerCopier/DisassemblerCopier.

Since:
Morph 1.1
Author:
Matt Benson
See Also:
http://www.martinfowler.com/eaaCatalog/dataTransferObject.html

Field Summary
protected static net.sf.composite.validate.ComponentValidator DEFAULT_VALIDATOR
          Default ComponentValidator; ignores empty component list
 
Fields inherited from class net.sf.morph.transform.transformers.BaseCompositeTransformer
components
 
Fields inherited from class net.sf.morph.transform.transformers.BaseTransformer
destinationClasses, log, sourceClasses
 
Fields inherited from interface net.sf.morph.transform.Transformer
TRANSFORMATION_TYPE_CONVERT, TRANSFORMATION_TYPE_COPY
 
Constructor Summary
protected AssemblyCopierSupport()
          Create a new AssemblyCopierSupport.
protected AssemblyCopierSupport(java.lang.Object[] components)
          Create a new AssemblyCopierSupport.
 
Method Summary
 java.lang.Class getComponentType()
          Return the component type of this transformer.
protected  ContainerReflector getContainerReflector()
          Get the ContainerReflector used by this Transformer.
protected  Copier getCopier(int index)
          Get the Copier that will perform the copy for index index.
 Transformer getNestedTransformer()
          Get the transformer (Copier) which, in the absence of a components list, will be used to perform nested transformations.
protected  void initializeImpl()
          Gives subclasses a chance to perform any computations needed to initialize the transformer.
 void setComponents(java.lang.Object[] components)
          
 void setComponentValidator(net.sf.composite.validate.ComponentValidator componentValidator)
          Set the ComponentValidator for this transformer.
 void setDestinationClasses(java.lang.Class[] destinationClasses)
          Configures the destinationClasses property of this transformer.
 void setNestedTransformer(Transformer nestedTransformer)
          Set the transformer (Copier) which, in the absence of a components list, will be used to perform nested transformations.
 void setSourceClasses(java.lang.Class[] sourceClasses)
          Configures the sourceClasses property of this transformer.
 
Methods inherited from class net.sf.morph.transform.transformers.BaseCompositeTransformer
getComponents, getComponentValidator, isNarrowingComponentArray, isWrappingRuntimeExceptions, updateNestedTransformerComponents
 
Methods inherited from class net.sf.morph.transform.transformers.BaseTransformer
clone, convert, convert, convertImpl, copy, copy, copyImpl, createDefaultReflector, createNewInstance, createNewInstanceImpl, createReusableSource, equals, equals, equalsUnidirectionalTest, getDestinationClasses, getDestinationClassesImpl, getInstantiatingReflector, getLocale, getLog, getReflector, getReflector, getSourceClasses, getSourceClassesImpl, getTransformableCallCache, getTransformerName, initialize, isAutomaticallyHandlingNulls, isCachingIsTransformableCalls, isImpreciseTransformation, isImpreciseTransformationImpl, isInitialized, isPerformingLogging, isTransformable, isTransformableImpl, setCachingIsTransformableCalls, setInitialized, setLog, setReflector, setTransformableCallCache, setTransformerName, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.morph.transform.Transformer
getDestinationClasses, getSourceClasses
 

Field Detail

DEFAULT_VALIDATOR

protected static final net.sf.composite.validate.ComponentValidator DEFAULT_VALIDATOR
Default ComponentValidator; ignores empty component list

Constructor Detail

AssemblyCopierSupport

protected AssemblyCopierSupport()
Create a new AssemblyCopierSupport.


AssemblyCopierSupport

protected AssemblyCopierSupport(java.lang.Object[] components)
Create a new AssemblyCopierSupport.

Parameters:
components -
Method Detail

initializeImpl

protected void initializeImpl()
                       throws java.lang.Exception
Gives subclasses a chance to perform any computations needed to initialize the transformer.

Overrides:
initializeImpl in class BaseCompositeTransformer
Throws:
java.lang.Exception
See Also:
BaseTransformer.initializeImpl()

getComponentType

public java.lang.Class getComponentType()
Return the component type of this transformer.

Specified by:
getComponentType in interface net.sf.composite.StrictlyTypedComposite
Overrides:
getComponentType in class BaseCompositeTransformer
Returns:
Class
See Also:
BaseCompositeTransformer.getComponentType()

setSourceClasses

public void setSourceClasses(java.lang.Class[] sourceClasses)
Configures the sourceClasses property of this transformer. Note that this method should be called before the transformer is used. Otherwise, if another thread is in the middle of transforming an object graph and this method is called, the behavior of the transformer can change partway through the transformation.

Overrides:
setSourceClasses in class BaseTransformer
Parameters:
sourceClasses - the new sourceClasses for this transformer
See Also:
BaseTransformer.setSourceClasses(java.lang.Class[])

setDestinationClasses

public void setDestinationClasses(java.lang.Class[] destinationClasses)
Configures the destinationClasses property of this transformer. Note that this method should be called before the transformer is used. Otherwise, if another thread is in the middle of transforming an object graph and this method is called, the behavior of the transformer can change partway through the transformation.

Overrides:
setDestinationClasses in class BaseTransformer
Parameters:
destinationClasses - the new destinationClasses for this transformer
See Also:
BaseTransformer.setDestinationClasses(java.lang.Class[])

getContainerReflector

protected ContainerReflector getContainerReflector()
Get the ContainerReflector used by this Transformer.

Returns:
ContainerReflector

setNestedTransformer

public void setNestedTransformer(Transformer nestedTransformer)
Set the transformer (Copier) which, in the absence of a components list, will be used to perform nested transformations.

Overrides:
setNestedTransformer in class BaseCompositeTransformer
Parameters:
nestedTransformer - the transformer used to perform nested transformations

getNestedTransformer

public Transformer getNestedTransformer()
Get the transformer (Copier) which, in the absence of a components list, will be used to perform nested transformations.

Overrides:
getNestedTransformer in class BaseTransformer
Returns:
nested Transformer

getCopier

protected Copier getCopier(int index)
Get the Copier that will perform the copy for index index.

Parameters:
index -
Returns:
Copier

setComponents

public void setComponents(java.lang.Object[] components)

Specified by:
setComponents in interface net.sf.composite.SimpleComposite
Overrides:
setComponents in class BaseCompositeTransformer
See Also:
BaseCompositeTransformer.setComponents(java.lang.Object[])

setComponentValidator

public void setComponentValidator(net.sf.composite.validate.ComponentValidator componentValidator)
Set the ComponentValidator for this transformer.

Overrides:
setComponentValidator in class BaseCompositeTransformer
Parameters:
componentValidator - ComponentValidator
See Also:
BaseCompositeTransformer.setComponentValidator(net.sf.composite.validate.ComponentValidator)


Copyright © 2004-2008.