Interface TypeTransformer<S,T>
- Type Parameters:
S
- The source typeT
- The target type
- All Known Implementing Classes:
AbstractTypeTransformer
,Alignment2URLTransformer
,Model2OntModelTransformer
,OntModel2URLTransformer
,Properties2URLTransformer
,URL2AlignmentTransformer
,URL2OntModelTransformer
,URL2OWLOntology
,URL2PropertiesTransformer
public interface TypeTransformer<S,T>
TypeTransformer interface. Classes implementing this interface can convert one java type to another.
TypeTransformers are loaded with the ServiceLoader of java.
Thus a so called provider-configuration file has to be placed in the resource directory META-INF/services/.
The name of this file needs to be de.uni_mannheim.informatik.dws.melt.matching_base.typetransformer.TypeTransformer
and the content should be a list of fully-qualified binary names of concrete classes which
implement TypeTransformer interface, one per line.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the source type as a class value.Returns the target type as a class value.int
getTransformationCost
(Properties parameters) Returns the transformation cost given the parameter.transform
(S value, Properties parameters) Transforms the given value to the new type.
-
Method Details
-
transform
Transforms the given value to the new type. There is only one instance of this TypeTransformer. So any attribute of the class is used in multiple transformations.- Parameters:
value
- the given value to convertparameters
- the parameters can contain any further hints for the transformation e.g. create OntModel with or without reasoning / in memory or in file etc.- Returns:
- the transformed value
- Throws:
TypeTransformationException
- in case the transformation did not work
-
getSourceType
Returns the source type as a class value. It is necessary because the generics are removed after compilation.- Returns:
- the source type as a class value
-
getTargetType
Returns the target type as a class value. It is necessary because the generics are removed after compilation.- Returns:
- the target type as a class value
-
getTransformationCost
Returns the transformation cost given the parameter. It is usually a good idea to reduce the tranformation cost, if more parameter can be used during the conversion.- Parameters:
parameters
- the parameters can contain any further hints for the transformation e.g. create OntModel with or without reasoning / in memory or in file etc.- Returns:
- a positive number which represents the transformation cost.
-