|
||||||||||
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.transformers.BaseCompositeTransformer
public abstract class BaseCompositeTransformer
Field Summary | |
---|---|
protected java.lang.Object[] |
components
Our component list |
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 | |
---|---|
BaseCompositeTransformer()
|
Method Summary | |
---|---|
java.lang.Object[] |
getComponents()
|
java.lang.Class |
getComponentType()
Return the component type of this transformer. |
net.sf.composite.validate.ComponentValidator |
getComponentValidator()
Return the ComponentValidator of this transformer. |
protected void |
initializeImpl()
Gives subclasses a chance to perform any computations needed to initialize the transformer. |
protected boolean |
isNarrowingComponentArray()
Learn whether we should automatically narrow the array type of components
to that returned by getComponentType() after validating the components. |
protected boolean |
isWrappingRuntimeExceptions()
Indicates whether runtime exceptions should be wrapped as TransformationException s. |
void |
setComponents(java.lang.Object[] components)
|
void |
setComponentValidator(net.sf.composite.validate.ComponentValidator componentValidator)
Set the ComponentValidator for this transformer. |
protected void |
setNestedTransformer(Transformer nestedTransformer)
NodeCopier.setNestedTransformer(Transformer) |
protected void |
updateNestedTransformerComponents(Transformer incoming,
Transformer outgoing)
Propagate our nested transformer to any component NodeCopiers. |
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 |
---|
protected java.lang.Object[] components
Constructor Detail |
---|
public BaseCompositeTransformer()
Method Detail |
---|
protected void initializeImpl() throws java.lang.Exception
initializeImpl
in class BaseTransformer
java.lang.Exception
BaseTransformer.initializeImpl()
public java.lang.Class getComponentType()
getComponentType
in interface net.sf.composite.StrictlyTypedComposite
public java.lang.Object[] getComponents()
getComponents
in interface net.sf.composite.SimpleComposite
SimpleComposite.getComponents()
public void setComponents(java.lang.Object[] components)
setComponents
in interface net.sf.composite.SimpleComposite
SimpleComposite.setComponents(java.lang.Object[])
public net.sf.composite.validate.ComponentValidator getComponentValidator()
public void setComponentValidator(net.sf.composite.validate.ComponentValidator componentValidator)
componentValidator
- ComponentValidatorprotected void setNestedTransformer(Transformer nestedTransformer)
BaseTransformer
NodeCopier.setNestedTransformer(Transformer)
setNestedTransformer
in class BaseTransformer
protected void updateNestedTransformerComponents(Transformer incoming, Transformer outgoing)
incoming
- outgoing
- protected boolean isWrappingRuntimeExceptions()
TransformationException
s. By default, this method returns
true
.
Simple transformers in Morph that operate on JDK types like Numbers and
Strings will usually set this value to true
so that they
throw TransformationExceptions if problems occur. More complex
transformers that operate on graphs of objects are encouraged to set this
value to false
so that runtime exceptions are not wrapped.
This way, problems accessing data will be expressed by the native API of
a user's domain objects and avoid the need to catch Morph-specific
exceptions (assuming the use of runtime exceptions in said domain
objects).
isWrappingRuntimeExceptions
in class BaseTransformer
true
BaseTransformer.isWrappingRuntimeExceptions()
protected boolean isNarrowingComponentArray()
components
to that returned by getComponentType()
after validating the components.
true
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |