1 15 package org.apache.hivemind.schema.rules; 16 17 import java.util.ArrayList ; 18 import java.util.List ; 19 import java.util.Map ; 20 21 import org.apache.hivemind.HiveMind; 22 import org.apache.hivemind.Location; 23 import org.apache.hivemind.internal.Module; 24 import org.apache.hivemind.schema.Translator; 25 26 32 public class ConfigurationTranslator implements Translator 33 { 34 public Object translate(Module contributingModule, Class propertyType, String inputValue, 35 Location location) 36 { 37 if (HiveMind.isBlank(inputValue)) 38 return null; 39 40 Object configuration = contributingModule.getConfiguration(inputValue); 44 if (configuration instanceof Map && propertyType.equals(List .class)) { 45 configuration = new ArrayList (((Map ) configuration).values()); 46 } 47 48 return configuration; 49 } 50 } | Popular Tags |