public class DefaultConverter extends Object implements ArooaConverter
ArooaConverter. This converter uses
a ConversionLookup to provide the
ConversionPath for the conversion. If none
is provided the DefaultConversionLookup is used.| Constructor and Description |
|---|
DefaultConverter() |
DefaultConverter(ConversionLookup convertlets)
Only Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<F,T> T |
convert(F from,
Class<T> required)
Perform a conversion.
|
<F,T> ConversionPath<F,T> |
findConversion(Class<F> fromClass,
Class<T> required)
Find a conversion in the convertletRegistry.
|
ConversionLookup |
getRegistry() |
public DefaultConverter(ConversionLookup convertlets)
convertlets - A ConvertletRegistry.public DefaultConverter()
public ConversionLookup getRegistry()
public <F,T> T convert(F from,
Class<T> required)
throws NoConversionAvailableException,
ConversionFailedException
ArooaValue and it's not already
the required ArooaValue then perform a conversion using the best conversion
found from the provided ArooaConversionKit. convert in interface ArooaConverterfrom - The Object to convert. May be null.required - The Class the object is to converted into.NoConversionAvailableException - If ther is no conversion to
the required type.ConversionFailedException - If applying the conversion failed.ArooaConverter.convert(java.lang.Object, java.lang.Class)public <F,T> ConversionPath<F,T> findConversion(Class<F> fromClass, Class<T> required)
findConversion in interface ConversionLookupfromClass - Class to convert from.required - Class to convert to.NoConversionAvailableException - If no conversion is available.Copyright © 2023. All rights reserved.