private void loadLanguageMappings(Properties props) { Enumeration<?> en = props.propertyNames(); while (en.hasMoreElements()) { String propName = (String) en.nextElement(); String propVal = props.getProperty(propName); if (propName.startsWith(".")) { // This is an extension mapping if (propName.equals(".")) { // The default mapping defaultLanguageImplName = propVal; } else { propName = propName.substring(1); extensionMappings.put(propName, propVal); } } else { // value is made up of an optional module name followed by colon followed by the // FQCN of the factory int colonIndex = propVal.lastIndexOf(COLON); String moduleName; String factoryName; if (colonIndex != -1) { moduleName = propVal.substring(0, colonIndex); factoryName = propVal.substring(colonIndex + 1); } else { throw new IllegalArgumentException( "Language mapping: " + propVal + " does not specify an implementing module"); } LanguageImplInfo langImpl = new LanguageImplInfo(moduleName, factoryName); languageImpls.put(propName, langImpl); extensionMappings.put(propName, propName); // automatically register the name as a mapping } } }