@SuppressWarnings("unchecked")
void loadOption(Map<String, Object> description, List<AnalysisEngineDescription> aes) {
try {
Map.Entry<String, Object> first = getFirst(description);
HandleType type = HandleType.getInstance(first.getKey());
if (type == HandleType.PIPELINE) {
List<Map<String, Object>> pipeline = (List<Map<String, Object>>) first.getValue();
List<AnalysisEngineDescription> options = createInnerPipeline(pipeline);
aes.addAll(options);
} else {
String resource = (String) first.getValue();
List<AnalysisEngineDescription> options = doLoadOptions(ResourceHandle.newHandle(type,
resource), description);
aes.addAll(options);
}
} catch (Exception e) {
System.err.printf("Unable to load option %s caused by:\n", description);
Throwable cause = e.getCause();
if (cause != null) {
cause.printStackTrace();
} else {
e.printStackTrace();
}
}
}