private static EntityFilterImpl createEntityFilter(Field field) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, IllegalAccessException, InvocationTargetException {
EntityFilterImpl filter = new EntityFilterImpl();
filter.setEmbeddedClass(field.getDeclaringClass());
filter.setPath(field.getName());
EntityFilter entityFilter = field.getAnnotation(EntityFilter.class);
filter.setRange(entityFilter.range());
filter.setType(entityFilter.type());
if (EntityFilter.WIDGET_TYPE.EMBEDDED.equals(filter.getType())) filter.setSubfilters(getSubFilters(field));
filter.setHelp(entityFilter.help());
String[] values = entityFilter.values();
if ((values != null) && (values.length > 0)) filter.setValues(Arrays.asList(values));