Commit 7ad843d5 authored by R.W.Majeed's avatar R.W.Majeed

allow map directives without case elements

parent 548a479d
......@@ -99,24 +99,26 @@ public abstract class Column<T> {
private void applyMapRules(String value, MapFeedback action){
boolean match = false;
Objects.requireNonNull(map.cases);
for( MapCase mc : map.cases ){
Objects.requireNonNull(mc.value);
if( mc.value.equals(value) ){
match = true;
if( mc.setValue != null ){
action.overrideValue(mc.setValue);
// no case may be present at all
if( map.cases != null ){
for( MapCase mc : map.cases ){
Objects.requireNonNull(mc.value);
if( mc.value.equals(value) ){
match = true;
if( mc.setValue != null ){
action.overrideValue(mc.setValue);
}
// set concept
if( mc.setConcept != null ){
action.overrideConcept(mc.setConcept);
}
// check action
if( mc.action != null && mc.action.equals("drop-fact") ){
action.dropFact();
// TODO check after loading for illegal values or use enum
}
break;
}
// set concept
if( mc.setConcept != null ){
action.overrideConcept(mc.setConcept);
}
// check action
if( mc.action != null && mc.action.equals("drop-fact") ){
action.dropFact();
// TODO check after loading for illegal values or use enum
}
break;
}
}
if( match == false && map.otherwise != null ){
......
Markdown is supported
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