public interface DataConverter extends Converter
Converter
interface. Serves as
bridge between two ContentType
instances.
Note that each DataConverter
implementation is supposed to handle
only one conversion, namely the one defined by the return values
of its getInputType()
and getResultType()
methods.
In addition the getAccuracy()
method returns an estimated
value of accuracy. This accuracy a
with 0<a
≤1
describes the amount of preserved content when converting data. A
value of 1
means there will be no loss of data, while a value
close to 0
indicates an almost entire loss. The framework regarding
content types (e.g. the ContentTypeRegistry
) uses this accuracy indicator
as a performance measurement when deciding which converter to use.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
convert(java.lang.Object source,
Options options) |
double |
getAccuracy() |
ContentType |
getInputType() |
ContentType |
getResultType() |
java.lang.Object convert(java.lang.Object source, Options options) throws DataConversionException
convert
in interface Converter
DataConversionException
ContentType getInputType()
ContentType getResultType()
double getAccuracy()