Type Parameters:
S - The source type
T - 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 Details

    • transform

      T transform(S value, Properties parameters) throws TypeTransformationException
      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 convert
      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:
      the transformed value
      Throws:
      TypeTransformationException - in case the transformation did not work
    • getSourceType

      Class<S> 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

      Class<T> 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

      int getTransformationCost(Properties parameters)
      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.