Package lumis.doui.source
Class AbstractSourceConverter
- java.lang.Object
-
- lumis.util.converter.AbstractConverter
-
- lumis.doui.source.AbstractSourceConverter
-
- All Implemented Interfaces:
ISourceConverter
,IConverter
@StableMinor(version="14.0", sinceVersion="4.0") public abstract class AbstractSourceConverter extends AbstractConverter implements ISourceConverter
Abstract implementation of aISourceConverter
, based onAbstractConverter
.- Since:
- 4.0.4
- Version:
- $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
-
-
Field Summary
Fields Modifier and Type Field Description protected ISourceContext
sourceContext
The source context that this source converter is associated with.
-
Constructor Summary
Constructors Constructor Description AbstractSourceConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract <T> T
doConversion(Class<T> type, Object value, Locale locale, String pattern)
Converts the specified input object into an output object of the specified type.void
init(ISourceContext sourceContext)
This method is called to initialize the converter to be used in the given source context.-
Methods inherited from class lumis.util.converter.AbstractConverter
convert, convert, convert, doesNullValueReturnNull, doesValueInstanceOfTypeReturnValue, getDefaultLocale, getDefaultPattern, setDefaultLocale, setDefaultPattern, setFallbackToRegisteredConverters, shouldFallbackToRegisteredConverters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.util.converter.IConverter
convert, convert, convert
-
-
-
-
Field Detail
-
sourceContext
protected ISourceContext sourceContext
The source context that this source converter is associated with.
-
-
Method Detail
-
doConversion
protected abstract <T> T doConversion(Class<T> type, Object value, Locale locale, String pattern) throws UnsupportedConversionTypeException
Description copied from class:AbstractConverter
Converts the specified input object into an output object of the specified type.- Specified by:
doConversion
in classAbstractConverter
- Type Parameters:
T
- generics support for the data type specified.- Parameters:
type
- data type to which the value should be converted.value
- the input value to be converted.locale
- locale to be used during conversion, if necessary.pattern
- converter specific conversion pattern, to be used during conversion, if necessary.- Throws:
UnsupportedConversionTypeException
- if this converter does not supports converting to the specified type.
-
init
public void init(ISourceContext sourceContext) throws PortalException
Description copied from interface:ISourceConverter
This method is called to initialize the converter to be used in the given source context. It is called before any convert methods. If the converter will be used on another source context, this method is called again.- Specified by:
init
in interfaceISourceConverter
- Parameters:
sourceContext
- the source context this converter will be used in.- Throws:
PortalException
-
-