use of org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapping in project stanbol by apache.
the class CacheUtils method writeFieldConfig.
/**
* Serialises all {@link FieldMapping}s of the parsed {@link FieldMapper}
* and stores them in the {@value Cache#FIELD_MAPPING_CONFIG_FIELD} of the
* parsed {@link Representation}
* @param config the representation to store the field mapping configuration
* @param mapper the field mapper with the configuration to store
*/
private static void writeFieldConfig(Representation config, FieldMapper mapper) {
StringBuilder builder = new StringBuilder();
for (FieldMapping mapping : mapper.getMappings()) {
builder.append(FieldMappingUtils.serialiseFieldMapping(mapping));
builder.append('\n');
}
config.set(Cache.FIELD_MAPPING_CONFIG_FIELD, builder.toString());
}
Aggregations