@Override public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { if (base != null && property != null) { context.setPropertyResolved(true); invalidValues = getValidator(base).getPotentialInvalidValues(property.toString(), value); } }
protected <T> ClassValidator<T> getValidator(Class<T> modelClass) { return Validators.instance().getValidator(modelClass); }
protected <T> ClassValidator<T> getValidator(T model) { return Validators.instance().getValidator(model); }
/** * Get the cached ClassValidator instance. If the argument is an instance of * a session bean Seam component instance, the returned validator will be * aware of constraints defined on the bean class. Therefore this method is * preferred to getValidator(Class) if the argument might be a session bean. * * @param model the object to be validated */ @SuppressWarnings("unchecked") public <T> ClassValidator<T> getValidator(T model) { Class<?> modelClass = model instanceof Instance ? ((Instance) model).getComponent().getBeanClass() : model.getClass(); return getValidator((Class<T>) modelClass); }