@Test(expected = IllegalArgumentException.class) public void throwsExceptionForUndefinedMetric() throws Exception { manager.instantiateMetric("blah.blah.NoMetric"); }
@Override public Metric instantiateMetric(String metricName) throws IllegalArgumentException, InstantiationException { final Metric metric; if (!metricConfiguration.containsKey(metricName)) { metric = super.instantiateMetric(metricName); } else { final String className = metricClasses.get(metricName); final Class<? extends Metric> klazz = findMetricClass(className); metric = instantiateClassWithConfiguration(klazz, metricConfiguration.get(metricName)); } return metric; }
ParameterizedMetricClassManager extends SimpleMetricClassManager implements MetricClassManager { @Override public Metric instantiateMetric(String metricName) throws IllegalArgumentException, InstantiationException { final Metric metric; if (!metricConfiguration.containsKey(metricName)) { metric = super.instantiateMetric(metricName); } else { final String className = metricClasses.get(metricName); final Class<? extends Metric> klazz = findMetricClass(className); metric = instantiateClassWithConfiguration(klazz, metricConfiguration.get(metricName)); } return metric; } }
ParameterizedMetricClassManager extends SimpleMetricClassManager implements MetricClassManager { @Override public Metric instantiateMetric(String metricName) throws IllegalArgumentException, InstantiationException { final Metric metric; if (!metricConfiguration.containsKey(metricName)) { metric = super.instantiateMetric(metricName); } else { final String className = metricClasses.get(metricName); final Class<? extends Metric> klazz = findMetricClass(className); metric = instantiateClassWithConfiguration(klazz, metricConfiguration.get(metricName)); } return metric; } @SuppressWarnings("rawtypes")  ParameterizedMetricClassManager(Collection<String> metricNames, Map<String, Map> metricConfiguration); }
ParameterizedMetricClassManager extends SimpleMetricClassManager implements MetricClassManager { @Override public Metric instantiateMetric(String metricName) throws IllegalArgumentException, InstantiationException { final Metric metric; if (!metricConfiguration.containsKey(metricName)) { metric = super.instantiateMetric(metricName); } else { final String className = metricClasses.get(metricName); final Class<? extends Metric> klazz = findMetricClass(className); metric = instantiateClassWithConfiguration(klazz, metricConfiguration.get(metricName)); } return metric; } @SuppressWarnings("rawtypes")  ParameterizedMetricClassManager(Collection<String> metricNames, Map<String, Map> metricConfiguration); @Override Metric instantiateMetric(String metricName); }
ParameterizedMetricClassManager extends SimpleMetricClassManager implements MetricClassManager { @Override public Metric instantiateMetric(String metricName) throws IllegalArgumentException, InstantiationException { final Metric metric; if (!metricConfiguration.containsKey(metricName)) { metric = super.instantiateMetric(metricName); } else { final String className = metricClasses.get(metricName); final Class<? extends Metric> klazz = findMetricClass(className); metric = instantiateClassWithConfiguration(klazz, metricConfiguration.get(metricName)); } return metric; } @SuppressWarnings("rawtypes")  ParameterizedMetricClassManager(Collection<String> metricNames, Map<String, Map> metricConfiguration); @Override Metric instantiateMetric(String metricName); static final String NAME_KEY; static final String MAXIMUM_GRADE_KEY; static final String MISSING_GRADE_KEY; }