@SuppressWarnings("unchecked") public BeanModel<?> getModel() { return beanModelSource.createEditModel(context.getPropertyType(), context.getContainerMessages()); } }
/** * Provide a select mode for an enum type. */ @SuppressWarnings("unchecked") public SelectModel getSelectModelForProperty() { Class propertyType = context.getPropertyType(); if (!Enum.class.isAssignableFrom(propertyType)) { throw new IllegalStateException("Cannot create a select model for property " + context.getPropertyId() + ". The property type is " + propertyType + " which is not an enum class."); } return new EnumSelectModel(propertyType, context.getContainerMessages()); }