Package cz.cvut.kbss.jopa.oom.converter
Class ToRdfLiteralConverter
java.lang.Object
cz.cvut.kbss.jopa.oom.converter.ToRdfLiteralConverter
- All Implemented Interfaces:
AttributeConverter<String,
,Object> ConverterWrapper<String,
Object>
Converter for working with RDF literals with explicit datatype mapping (
Literal
).
The attribute value then represents the lexical form of the literal and should be a String
.
Note that the conversion to attribute value does not perform any validation regarding match between the value and the specified datatype IRI.
So, for example, a value read from the repository as Integer
will be mapped by this converter to an attribute with
datatype xsd:boolean
without any exceptions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertToAttribute
(Object value) Converts the data stored in the repository into the value to be stored in the entity attribute.convertToAxiomValue
(String 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.boolean
supportsAxiomValueType
(Class<?> type) Checks whether the wrapped converter supports converting the specified axiom value type.
-
Constructor Details
-
ToRdfLiteralConverter
-
-
Method Details
-
convertToAxiomValue
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 interfaceAttributeConverter<String,
Object> - Parameters:
value
- Value to convert- Returns:
- Converted data
-
convertToAttribute
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 interfaceAttributeConverter<String,
Object> - Parameters:
value
- Value to convert- Returns:
- Converted data
-
supportsAxiomValueType
Description copied from interface:ConverterWrapper
Checks whether the wrapped converter supports converting the specified axiom value type.- Specified by:
supportsAxiomValueType
in interfaceConverterWrapper<String,
Object> - Parameters:
type
- Axiom value type- Returns:
- Whether the type is supported by this wrapper
-