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));
if (logger.isDebugEnabled()) logger.debug("Adding filter [" + filter + "] to view");
return filter;
}