|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.morph.transform.transformers.BaseTransformer net.sf.morph.transform.copiers.SetExpressionCopier
public class SetExpressionCopier
Uses a DecoratedLanguage to set the property denoted by an expression on the destination object.
Field Summary |
---|
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 |
Fields inherited from interface net.sf.morph.transform.Transformer |
---|
TRANSFORMATION_TYPE_CONVERT, TRANSFORMATION_TYPE_COPY |
Fields inherited from interface net.sf.morph.transform.Transformer |
---|
TRANSFORMATION_TYPE_CONVERT, TRANSFORMATION_TYPE_COPY |
Fields inherited from interface net.sf.morph.transform.Transformer |
---|
TRANSFORMATION_TYPE_CONVERT, TRANSFORMATION_TYPE_COPY |
Constructor Summary | |
---|---|
SetExpressionCopier()
Create a new SetExpressionCopier. |
|
SetExpressionCopier(java.lang.String expression)
Create a new SetExpressionCopier. |
Method Summary | |
---|---|
protected void |
copyImpl(java.lang.Object destination,
java.lang.Object source,
java.util.Locale locale,
java.lang.Integer preferredTransformationType)
Implementation of the copy method. |
protected java.lang.Class[] |
getDestinationClassesImpl()
Transformer.getDestinationClasses() implementation template method. |
java.lang.String |
getExpression()
Get the String expression. |
DecoratedLanguage |
getLanguage()
Get the DecoratedLanguage language. |
protected java.lang.Class[] |
getSourceClassesImpl()
Transformer.getSourceClasses() implementation template method. |
protected void |
initializeImpl()
Gives subclasses a chance to perform any computations needed to initialize the transformer. |
protected boolean |
isAutomaticallyHandlingNulls()
Indicates whether null values will automatically be
converted to null by this base class before even calling
the subclass's BaseTransformer.convertImpl(Class, Object, Locale) method. |
void |
setDestinationClasses(java.lang.Class[] destinationClasses)
Configures the destinationClasses property of this
transformer. |
void |
setExpression(java.lang.String expression)
Set the String expression. |
void |
setLanguage(DecoratedLanguage language)
Set the DecoratedLanguage language. |
void |
setSourceClasses(java.lang.Class[] sourceClasses)
Configures the sourceClasses property of this transformer. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.morph.transform.DecoratedCopier |
---|
copy |
Methods inherited from interface net.sf.morph.transform.Copier |
---|
copy |
Methods inherited from interface net.sf.morph.transform.Transformer |
---|
getDestinationClasses, getSourceClasses |
Methods inherited from interface net.sf.morph.transform.Transformer |
---|
getDestinationClasses, getSourceClasses |
Methods inherited from interface net.sf.morph.transform.ExplicitTransformer |
---|
isTransformable |
Methods inherited from interface net.sf.morph.transform.DecoratedConverter |
---|
convert, equals, equals |
Methods inherited from interface net.sf.morph.transform.Converter |
---|
convert |
Methods inherited from interface net.sf.morph.transform.Transformer |
---|
getDestinationClasses, getSourceClasses |
Methods inherited from interface net.sf.morph.transform.Transformer |
---|
getDestinationClasses, getSourceClasses |
Methods inherited from interface net.sf.morph.transform.ExplicitTransformer |
---|
isTransformable |
Constructor Detail |
---|
public SetExpressionCopier()
public SetExpressionCopier(java.lang.String expression)
Method Detail |
---|
protected void initializeImpl() throws java.lang.Exception
initializeImpl
in class BaseTransformer
java.lang.Exception
BaseTransformer.initializeImpl()
protected void copyImpl(java.lang.Object destination, java.lang.Object source, java.util.Locale locale, java.lang.Integer preferredTransformationType) throws java.lang.Exception
copyImpl
in class BaseTransformer
java.lang.Exception
BaseTransformer.copyImpl(java.lang.Object, java.lang.Object, java.util.Locale, java.lang.Integer)
public void setDestinationClasses(java.lang.Class[] destinationClasses)
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.
setDestinationClasses
in class BaseTransformer
destinationClasses
- the new destinationClasses
for this transformerBaseTransformer.setDestinationClasses(java.lang.Class[])
protected java.lang.Class[] getDestinationClassesImpl() throws java.lang.Exception
Transformer.getDestinationClasses()
implementation template method.
getDestinationClassesImpl
in class BaseTransformer
java.lang.Exception
BaseTransformer.getDestinationClassesImpl()
public void setSourceClasses(java.lang.Class[] sourceClasses)
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.
setSourceClasses
in class BaseTransformer
sourceClasses
- the new sourceClasses
for this transformerBaseTransformer.setSourceClasses(java.lang.Class[])
protected java.lang.Class[] getSourceClassesImpl() throws java.lang.Exception
Transformer.getSourceClasses()
implementation template method.
getSourceClassesImpl
in class BaseTransformer
java.lang.Exception
BaseTransformer.getSourceClassesImpl()
public java.lang.String getExpression()
public void setExpression(java.lang.String expression)
expression
- Stringpublic DecoratedLanguage getLanguage()
public void setLanguage(DecoratedLanguage language)
language
- DecoratedLanguageprotected boolean isAutomaticallyHandlingNulls()
null
values will automatically be
converted to null
by this base class before even calling
the subclass's BaseTransformer.convertImpl(Class, Object, Locale)
method.
Subclasses which depend on this behavior (which is all subclasses, by
default) should include null
as one of their source and
destination classes so that the actual behavior of the transformer is
consistent with the values that are returned by the
BaseTransformer.isTransformable(Class, Class)
method. The conversions will
happen automatically even if the source and destination classes don't
contain null
, but for the sake of consistency the
null
s should be included.
isAutomaticallyHandlingNulls
in class BaseTransformer
null
values will automatically be
converted to null
by this base class before even
calling the subclass's
BaseTransformer.convertImpl(Class, Object, Locale)
method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |