예제 #1
0
 private void instantiateFeatures(DeviceType dt) {
   for (Entry<String, String> fe : dt.getFeatures().entrySet()) {
     DeviceFeature f = DeviceFeature.s_makeDeviceFeature(fe.getValue());
     if (f == null) {
       logger.error("device type {} references unknown feature: {}", dt, fe.getValue());
     } else {
       addFeature(fe.getKey(), f);
     }
   }
   for (Entry<String, FeatureGroup> fe : dt.getFeatureGroups().entrySet()) {
     FeatureGroup fg = fe.getValue();
     DeviceFeature f = DeviceFeature.s_makeDeviceFeature(fg.getType());
     if (f == null) {
       logger.error("device type {} references unknown feature group: {}", dt, fg.getType());
     } else {
       addFeature(fe.getKey(), f);
     }
     connectFeatures(fe.getKey(), f, fg.getFeatures());
   }
 }