return QuickFIXUtils.getDictionary(beginString);
}
public static DataDictionary getDictionary(String beginString) throws FIXException {
DataDictionary dictionary = dictionaryCache.get(beginString);
if (dictionary == null) {
if (!BEGIN_STRINGS.contains(beginString)) {
throw new HermesRuntimeException("Invalid FIX BeginString: '" + beginString + "'.");
}
String dictionaryFileName = null ;
if (beginString.equals(FixVersions.BEGINSTRING_FIXT11)) {
dictionaryFileName = "quickfix/" + FixVersions.FIX50.replaceAll("\\.", "") + ".xml";
} else {
dictionaryFileName = "quickfix/" + beginString.replaceAll("\\.", "") + ".xml";
}
// the dictionary is loaded from the quickfix.jar file.
InputStream ddis = Thread.currentThread().getContextClassLoader().getResourceAsStream(dictionaryFileName);
if (ddis == null) {
throw new NullPointerException("Data Dictionary file '" + dictionaryFileName + "' not found at root of CLASSPATH.");
}
try {
dictionary = new DataDictionary(ddis);
dictionaryCache.put(beginString, dictionary);
} catch (ConfigError configError) {
throw new HermesRuntimeException("Error loading data dictionary file.", configError);
}