Exemplo n.º 1
0
  private Dictionary mergeBase(String subDictID) {
    Dictionary baseDict = new Dictionary(subDictID);
    Dictionary stateData = getDefaultStateData();

    if (stateData != null && stateData.found(subDictID)) {
      baseDict.merge(stateData.subDict(subDictID));
    } else {
      logger.warn("'" + subDictID + "' NOT FOUND");
    }

    // System.out.println("AbstractDefaultsProvider.mergeBase() "+baseDict);

    if (baseDict.found("base")) {
      String baseName = baseDict.lookup("base");
      Dictionary bd = mergeBase(baseName);
      bd.merge(baseDict);
      return bd;
    }

    return baseDict;
  }
Exemplo n.º 2
0
 static Dictionary extractModule(
     DefaultsProvider defaults, String encodedPrimalState, String moduleName) {
   if (defaults.getDefaultStateData().found(moduleName)) {
     Dictionary defaultModule = new Dictionary(defaults.getDefaultStateData().subDict(moduleName));
     Dictionary relativeToStateModule =
         extractRelativeToStateModule(encodedPrimalState, defaultModule);
     if (relativeToStateModule != null) {
       defaultModule.merge(relativeToStateModule);
     }
     return defaultModule;
   }
   return null;
 }