net.sf.morph.transform.converters
Class DefaultToBooleanConverter
java.lang.Object
net.sf.morph.transform.transformers.BaseTransformer
net.sf.morph.transform.transformers.BaseCompositeTransformer
net.sf.morph.transform.transformers.SimpleDelegatingTransformer
net.sf.morph.transform.converters.DefaultToBooleanConverter
- All Implemented Interfaces:
- java.lang.Cloneable, net.sf.composite.Component, net.sf.composite.Composite, net.sf.composite.SimpleComposite, net.sf.composite.SpecializableComposite, net.sf.composite.StrictlyTypedComposite, Converter, Copier, DecoratedConverter, DecoratedCopier, DecoratedTransformer, ExplicitTransformer, ImpreciseTransformer, Transformer
public class DefaultToBooleanConverter
- extends SimpleDelegatingTransformer
Converts any object to a Boolean by delegating to
TextToBooleanConverter
,
NumberToBooleanConverter
and
ObjectToBooleanConverter
.
- Since:
- Dec 29, 2004
- Author:
- Matt Sgarlata
- See Also:
SimpleDelegatingTransformer
,
DefaultToBooleanConverter#COMPONENTS
,
TextToBooleanConverter
,
NumberToBooleanConverter
,
ObjectToBooleanConverter
Methods inherited from class net.sf.morph.transform.transformers.SimpleDelegatingTransformer |
clearVisitedSourceToDestinationMapIfNecessary, clone, convertImpl, copyImpl, createReusableSource, decrementStackDepth, getCachedResult, getComponents, getCopier, getSourceClassesImpl, getSpecializer, getTransformer, getTransformer, getTransformers, getVisitedSourceToDestinationMap, hasVisited, hasVisitedDestination, incrementStackDepth, initializeImpl, isAutomaticallyHandlingNulls, isImpreciseTransformationImpl, isPerformingLogging, isPreferPreciseTransformers, isSpecializable, recordVisit, setComponents, setPreferPreciseTransformers, setSpecializer, specialize |
Methods inherited from class net.sf.morph.transform.transformers.BaseTransformer |
convert, convert, copy, copy, createDefaultReflector, createNewInstance, createNewInstanceImpl, equals, equals, equalsUnidirectionalTest, getDestinationClasses, getInstantiatingReflector, getLocale, getLog, getNestedTransformer, getReflector, getReflector, getSourceClasses, getTransformableCallCache, getTransformerName, initialize, isCachingIsTransformableCalls, isImpreciseTransformation, isInitialized, isTransformable, setCachingIsTransformableCalls, setDestinationClasses, setInitialized, setLog, setReflector, setSourceClasses, 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.Copier |
copy |
DefaultToBooleanConverter
public DefaultToBooleanConverter()
createDefaultComponents
protected Transformer[] createDefaultComponents()
- Create the default set of Transformer components.
- Overrides:
createDefaultComponents
in class SimpleDelegatingTransformer
- Returns:
- Transformer[]
getDestinationClassesImpl
protected java.lang.Class[] getDestinationClassesImpl()
throws java.lang.Exception
Transformer.getDestinationClasses()
implementation template method.
- Overrides:
getDestinationClassesImpl
in class SimpleDelegatingTransformer
- Returns:
- Class[]
- Throws:
java.lang.Exception
- See Also:
BaseTransformer.getDestinationClassesImpl()
isTransformableImpl
protected boolean isTransformableImpl(java.lang.Class destinationType,
java.lang.Class sourceType)
throws java.lang.Exception
- Determines if one of the delegate transformers is capable of performing
the given transformation. This method is necessary because otherwise the
delegating transformer would be too eager in what it says it can convert.
For example, if a delegate transformer was capable of transforming A to B
and another delegate was capable of transforming C to D, this transformer
would incorrectly state that transforming A to D and C to B was possible
even though they are not.
- Overrides:
isTransformableImpl
in class SimpleDelegatingTransformer
- Parameters:
destinationType
- the destination type to testsourceType
- the source type to test
- Returns:
- whether the destination type is transformable to the source type
- Throws:
TransformationException
- if it could not be determined if sourceType
is transformable into destinationType
java.lang.Exception
Copyright © 2004-2008.