* @throws if the parsed {@link Representation} does not contain a value for {@value CacheConstants.FIELD_MAPPING_CONFIG_FIELD}.
*/
private static FieldMapper readFieldConfig(Yard yard,Representation config, NamespacePrefixService nsPrefixService) {
Object mappingValue = config.getFirst(Cache.FIELD_MAPPING_CONFIG_FIELD);
if(mappingValue != null){
DefaultFieldMapperImpl fieldMapper = new DefaultFieldMapperImpl(ValueConverterFactory.getDefaultInstance());
for(String mappingStirng : mappingValue.toString().split("\n")){
FieldMapping mapping = FieldMappingUtils.parseFieldMapping(mappingStirng, nsPrefixService);
if(mapping != null){
log.info(" > add Mapping: "+mappingStirng);
fieldMapper.addMapping(mapping);
}
}
return fieldMapper;
} else {
return null;