|
||||||||||
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.BaseReflectorTransformer net.sf.morph.transform.converters.BaseToPrettyTextConverter
public abstract class BaseToPrettyTextConverter
Base class for converts that convert objects to a pretty programmer-friendly representation using information retrieved using a reflector.
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 |
Constructor Summary | |
---|---|
BaseToPrettyTextConverter()
|
Method Summary | |
---|---|
protected java.lang.Class[] |
getDestinationClassesImpl()
Transformer.getDestinationClasses() implementation template method. |
protected java.lang.Class |
getIntermediateClass()
Get the intermediate class passed to the text converter. |
java.lang.String |
getPrefix()
Get the prefix. |
java.lang.String |
getSeparator()
Get the separator. |
java.lang.String |
getSuffix()
Get the suffix. |
Converter |
getTextConverter()
Get the text converter used by this BaseToPrettyTextConverter. |
Converter |
getToTextConverter()
Get the "to text" converter used by this BaseToPrettyTextConverter. |
protected boolean |
isImpreciseTransformationImpl(java.lang.Class destinationClass,
java.lang.Class sourceClass)
Implementation of isImpreciseTransformation |
protected boolean |
isPerformingLogging()
Indicates if calls to the main transformation methods (convert, copy) will cause a log message to be recorded |
boolean |
isShowNullValues()
Learn whether this BaseToPrettyTextConverter is configured to show null values. |
protected boolean |
isWrappingRuntimeExceptions()
Indicates whether runtime exceptions should be wrapped as TransformationException s. |
void |
setPrefix(java.lang.String prefix)
Set the prefix. |
void |
setSeparator(java.lang.String separator)
Set the separator. |
void |
setShowNullValues(boolean showNullValues)
Set whether this BaseToPrettyTextConverter should show null values. |
void |
setSuffix(java.lang.String suffix)
Set the suffix. |
void |
setTextConverter(Converter textConverter)
Set the text converter used by this BaseToPrettyTextConverter. |
void |
setToTextConverter(Converter objectToTextConverter)
Set the "to text" converter used by this BaseToPrettyTextConverter. |
Methods inherited from class net.sf.morph.transform.transformers.BaseReflectorTransformer |
---|
getBeanReflector, getContainerReflector, getGrowableContainerReflector, getIndexedContainerReflector, getMutableIndexedContainerReflector, getSourceClassesImpl, hasReflector |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 |
Methods inherited from interface net.sf.morph.transform.ImpreciseTransformer |
---|
isImpreciseTransformation |
Constructor Detail |
---|
public BaseToPrettyTextConverter()
Method Detail |
---|
protected java.lang.Class[] getDestinationClassesImpl() throws java.lang.Exception
Transformer.getDestinationClasses()
implementation template method.
getDestinationClassesImpl
in class BaseReflectorTransformer
java.lang.Exception
protected boolean isPerformingLogging()
isPerformingLogging
in class BaseTransformer
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
public java.lang.String getSeparator()
public void setSeparator(java.lang.String separator)
separator
- public java.lang.String getPrefix()
public void setPrefix(java.lang.String prefix)
prefix
- public java.lang.String getSuffix()
public void setSuffix(java.lang.String suffix)
suffix
- public Converter getTextConverter()
public void setTextConverter(Converter textConverter)
textConverter
- public Converter getToTextConverter()
public void setToTextConverter(Converter objectToTextConverter)
objectToTextConverter
- public boolean isShowNullValues()
public void setShowNullValues(boolean showNullValues)
false
.
showNullValues
- protected boolean isImpreciseTransformationImpl(java.lang.Class destinationClass, java.lang.Class sourceClass)
isImpreciseTransformationImpl
in class BaseTransformer
protected java.lang.Class getIntermediateClass()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |