Class ToMultilingualStringConverter

java.lang.Object
cz.cvut.kbss.jopa.oom.converter.ToMultilingualStringConverter
All Implemented Interfaces:
AttributeConverter<MultilingualString,Object>, ConverterWrapper<MultilingualString,Object>

public class ToMultilingualStringConverter extends Object implements ConverterWrapper<MultilingualString,Object>
Supports mapping selected value types to multilingual strings.

This is not a general-purpose converter, it should be used only by the mapping of referenced lists containing multilingual string values.

  • Constructor Details

    • ToMultilingualStringConverter

      public ToMultilingualStringConverter()
  • Method Details

    • convertToAxiomValue

      public Object convertToAxiomValue(MultilingualString value)
      Description copied from interface: AttributeConverter
      Converts the value stored in the entity attribute into the data representation to be stored in the repository and supported by the OntoDriver API.
      Specified by:
      convertToAxiomValue in interface AttributeConverter<MultilingualString,Object>
      Parameters:
      value - Value to convert
      Returns:
      Converted data
    • convertToAttribute

      public MultilingualString convertToAttribute(Object value)
      Description copied from interface: AttributeConverter
      Converts the data stored in the repository into the value to be stored in the entity attribute.

      Note that it is the responsibility of the converter writer to specify the correct value type for the corresponding value for use by the OntoDriver: i.e., persistence providers are not expected to do such type conversion.

      Specified by:
      convertToAttribute in interface AttributeConverter<MultilingualString,Object>
      Parameters:
      value - Value to convert
      Returns:
      Converted data
    • supportsAxiomValueType

      public boolean supportsAxiomValueType(Class<?> type)
      Description copied from interface: ConverterWrapper
      Checks whether the wrapped converter supports converting the specified axiom value type.
      Specified by:
      supportsAxiomValueType in interface ConverterWrapper<MultilingualString,Object>
      Parameters:
      type - Axiom value type
      Returns:
      Whether the type is supported by this wrapper