/**
* @inheritDoc
*/
public EmpireConfiguration read(Reader theReader) throws IOException {
Properties aProps = new EnhancedProperties();
try {
aProps.load(theReader);
}
catch (Exception e) {
throw new IOException(e);
}
int aIndex = 0;
Map<String, String> aGeneralConfig = new HashMap<String, String>();
Map<String, Map<String, String>> aUnitConfig = new HashMap<String, Map<String, String>>();
while (aProps.containsKey(aIndex+"."+KEY_NAME)) {
String aPrefix = aIndex+".";
Map<String, String> aUnit = new HashMap<String, String>();
for (Object aOrigKey : Collections2.filter(aProps.keySet(), new PrefixPredicate(aPrefix))) {
String aKey = aOrigKey.toString();
aKey = aKey.substring(aPrefix.length());
aUnit.put(aKey, aProps.getProperty(aOrigKey.toString()));
}
aUnitConfig.put(aProps.getProperty(aIndex+"."+KEY_NAME), aUnit);
aIndex++;
}
for (Object aOrigKey : Collections2.filter(aProps.keySet(), new UnitFilterPredicate())) {
aGeneralConfig.put(aOrigKey.toString(), aProps.getProperty(aOrigKey.toString()));
}
EmpireConfiguration aConfig = new EmpireConfiguration(aGeneralConfig, aUnitConfig);
if (aGeneralConfig.containsKey(KEY_ANNOTATION_PROVIDER)) {