/** * <!-- getTestingMetric() --> Call the <code>getTestingMetric()</code> method of * {@link #learnerClass} and return the testing metric it returns. **/ private TestingMetric getTestingMetric() { TestingMetric testingMetric = null; if (lce.testingMetric != null) { Method getTestingMetric = null; try { getTestingMetric = learnerClass.getDeclaredMethod("getTestingMetric", new Class[0]); } catch (Exception e) { reportError(lce.line, "Could not access method'" + getName() + ".getTestingMetric()': " + e); return null; } try { testingMetric = (TestingMetric) getTestingMetric.invoke(null, null); } catch (Exception e) { System.err.println("Could not instantiate testing metric '" + lce.parser.name + "': " + e + ", caused by"); System.err.print(stackTrace(e.getCause())); return null; } } else testingMetric = new Accuracy(); return testingMetric; }