Commit 28c0d690 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Rename function for better understanding.

parent 8785eb4d
......@@ -112,7 +112,7 @@ class MappingConfig(directory: String) {
// literal properties
KEYS.name, KEYS.title, KEYS.descriptiveNote, KEYS.scopeAndContent, KEYS.sameAs,
KEYS.abstract, KEYS.source, KEYS.hasSponsoringAgent, KEYS.hasFindingAid ->
recordFieldMappers.add(buildSimpleMappers(entry))
recordFieldMappers.add(buildDirectMappers(entry))
KEYS.rights ->
recordFieldMappers.addAll(buildRuleMappers(entry.value))
KEYS.titles ->
......@@ -196,7 +196,7 @@ class MappingConfig(directory: String) {
KEYS.descriptiveNote, KEYS.medium, KEYS.physicalCharacteristics,
KEYS.colour, KEYS.duration, KEYS.displayAspectRatio, KEYS.audioTrackConfiguration,
KEYS.playbackSpeed, KEYS.hasStandard ->
physicalObjectFieldMappers.add(buildSimpleMappers(entry))
physicalObjectFieldMappers.add(buildDirectMappers(entry))
KEYS.identifiers ->
physicalObjectFieldMappers.addAll(buildIdentifierMapper(entry.value))
KEYS.rights ->
......@@ -210,7 +210,7 @@ class MappingConfig(directory: String) {
for (entry in source) {
when (val key = entry.key) {
KEYS.locator, KEYS.descriptiveNote, KEYS.duration ->
digitalObjectFieldMappers.add(buildSimpleMappers(entry))
digitalObjectFieldMappers.add(buildDirectMappers(entry))
KEYS.rights ->
digitalObjectFieldMappers.addAll(buildRuleMappers(entry.value))
else -> throw InvalidMappingException("Unknown key '$key' in digital object mapping.")
......@@ -218,7 +218,7 @@ class MappingConfig(directory: String) {
}
}
private fun buildSimpleMappers(value: Any?): IFieldMapper {
private fun buildDirectMappers(value: Any?): IFieldMapper {
return when (val field = parseField(value as Map.Entry<String, Any>)) {
is SimpleField -> SimpleFieldMapper(field)
is ConstField -> ConstantFieldMapper(field)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment