use of org.qi4j.api.value.ValueSerializer.Options in project qi4j-sdk by Qi4j.
the class EntityStateSerializer method serializeProperty.
private void serializeProperty(PropertyDescriptor persistentProperty, Object property, Resource subject, Graph graph, boolean includeNonQueryable) {
if (!(includeNonQueryable || persistentProperty.queryable())) {
// Skip non-queryable
return;
}
ValueType valueType = persistentProperty.valueType();
final ValueFactory valueFactory = graph.getValueFactory();
String propertyURI = persistentProperty.qualifiedName().toURI();
URI predicate = valueFactory.createURI(propertyURI);
String baseURI = propertyURI.substring(0, propertyURI.indexOf('#')) + "/";
if (valueType instanceof ValueCompositeType) {
serializeValueComposite(subject, predicate, (ValueComposite) property, valueType, graph, baseURI, includeNonQueryable);
} else {
String stringProperty = valueSerializer.serialize(new Options().withoutTypeInfo(), property);
final Literal object = valueFactory.createLiteral(stringProperty);
graph.add(subject, predicate, object);
}
}
Aggregations