/** * Resolves a string reference, as specified in the <code>on</code> parameter of * a {@link Bound} annotation to an Enum object in this runtime. * @param on <code>on</code> parameter from a {@link Bound} annotation. * @param model * @return the resolved object * @throws IllegalArgumentException if the referenced object can't be found. */ public static ModelUpdate findOnObject(final String on, final BindableModel model) { ModelUpdate onObject = null; if (!isNullOrBlank(on)) { final List<Class<?>> updateClasses = findModelUpdateClass(model); for (Class<?> updateClass : updateClasses) { try { onObject = (ModelUpdate)Reflections.evalEnum(updateClass, on); return onObject; } catch (IllegalArgumentException e) { // swallow this if we don't find the enum on one of the // classes, continue to next class. } } throw new IllegalArgumentException("could not find \"on\" parameter " + on); } return onObject; }