Package cz.cvut.kbss.jopa.oom.converter
Class ObjectConverter
java.lang.Object
cz.cvut.kbss.jopa.oom.converter.ObjectConverter
- All Implemented Interfaces:
- AttributeConverter<Object,,- Object> - ConverterWrapper<Object,- Object> 
Allows to convert values between arbitrary types.
 
 The main intended use is for annotation property mapping to attributes of type Object, which can hold both
 literal values and references to other individuals. In that case, the loaded instance is a NamedResource and
 needs to be transformed to a URI to prevent the internal OntoDriver API from leaking into the
 application.
 
 Similarly, OntoDriver API's LangString is transformed to MultilingualString.
 
In all other cases, the values will be just returned without any conversion.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionconvertToAttribute(Object value) Converts the data stored in the repository into the value to be stored in the entity attribute.convertToAxiomValue(Object value) Converts the value stored in the entity attribute into the data representation to be stored in the repository and supported by the OntoDriver API.booleanbooleansupportsAxiomValueType(Class<?> type) Checks whether the wrapped converter supports converting the specified axiom value type.
- 
Constructor Details- 
ObjectConverterpublic ObjectConverter()
- 
ObjectConverterpublic ObjectConverter(boolean preferMultilingualString) 
 
- 
- 
Method Details- 
convertToAxiomValueDescription copied from interface:AttributeConverterConverts 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:
- convertToAxiomValuein interface- AttributeConverter<Object,- Object> 
- Parameters:
- value- Value to convert
- Returns:
- Converted data
 
- 
convertToAttributeDescription copied from interface:AttributeConverterConverts 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 valuetype for the corresponding value for use by the OntoDriver: i.e., persistence providers are not expected to do such type conversion.- Specified by:
- convertToAttributein interface- AttributeConverter<Object,- Object> 
- Parameters:
- value- Value to convert
- Returns:
- Converted data
 
- 
supportsAxiomValueTypeDescription copied from interface:ConverterWrapperChecks whether the wrapped converter supports converting the specified axiom value type.- Specified by:
- supportsAxiomValueTypein interface- ConverterWrapper<Object,- Object> 
- Parameters:
- type- Axiom value type
- Returns:
- Whether the type is supported by this wrapper
 
- 
doesPreferMultilingualStringpublic boolean doesPreferMultilingualString()
 
-