public interface IlvConverter
IlvConverter
object is called by the class
IlvConvert
to convert a value from one type
to another.
A single IlvConverter
can handle one or more source and target types.
There is a number of predefined converters that convert values
from one of the Java primitive types to another, see IlvConvert
.
Additional value converters can be defined with the
method IlvConvert.addConverter(ilog.views.util.convert.IlvConverter)
;
The code comes from BGO IlvValueFilter
IlvLocalizedConverter
Modifier and Type | Field and Description |
---|---|
static Class<?>[] |
STRING_TYPE
An array which contains only String.class, it's the most current source or target type.
|
Modifier and Type | Method and Description |
---|---|
Object |
convert(Object value,
Class<?> toType)
Converts the specified value to the given type.
|
Class<?>[] |
fromTypes()
Returns the source types that this converter can handle, that is, the
types that can be converted to the target types declared
by
toTypes . |
Class<?>[] |
toTypes()
Returns the target types that this converter can handle, that is, the
types to which the source types declared
by
fromTypes can be converted. |
static final Class<?>[] STRING_TYPE
Class<?>[] fromTypes()
toTypes
.Class<?>[] toTypes()
fromTypes
can be converted.Object convert(Object value, Class<?> toType) throws IlvConvertException
The converted value
will be of one of the types returned by
fromTypes
.
All other combinations of source/target
types declared by fromTypes
/toTypes
should be handled by this method.
If the operation fails, this method must throw an exception of type
IlvConvertException
.
value
- the value to be converted. Assumed to be non-null.toType
- the target type.IlvConvertException
- if the value could not be converted to the
requested type.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.