public abstract class AbstractStandardConversionService extends Object implements IStandardConversionService
Base abstract class meant to be extended by most implementations of the IStandardConversionService
interface.
This abstract class separates the to-String conversions (the most common) and the rest of them.
Modifier | Constructor and Description |
---|---|
protected |
AbstractStandardConversionService() |
Modifier and Type | Method and Description |
---|---|
<T> T |
convert(IExpressionContext context,
Object object,
Class<T> targetClass)
Convert a value to the specified target class, if possible.
|
protected <T> T |
convertOther(IExpressionContext context,
Object object,
Class<T> targetClass) |
protected String |
convertToString(IExpressionContext context,
Object object) |
public final <T> T convert(IExpressionContext context, Object object, Class<T> targetClass)
IStandardConversionService
Convert a value to the specified target class, if possible.
Might raise an exception (usually IllegalArgumentException
) if a conversion is not available
for the specified object and the target class.
convert
in interface IStandardConversionService
T
- the type of the target classcontext
- the context object.object
- the object to be converted.targetClass
- the target class the object should be converted to.protected String convertToString(IExpressionContext context, Object object)
protected <T> T convertOther(IExpressionContext context, Object object, Class<T> targetClass)
Copyright © 2017 The THYMELEAF team. All rights reserved.