Search in sources :

Example 1 with Searchable

use of com.manydesigns.elements.annotations.Searchable in project Portofino by ManyDesigns.

the class SearchFormBuilder method configReflectiveFields.

public SearchFormBuilder configReflectiveFields() {
    logger.debug("configReflectiveFields");
    propertyAccessors = new ArrayList<>();
    for (PropertyAccessor current : classAccessor.getProperties()) {
        if (!isPropertyEnabled(current)) {
            continue;
        }
        // check if field is searchable
        Searchable searchableAnnotation = current.getAnnotation(Searchable.class);
        if (searchableAnnotation != null && !searchableAnnotation.value()) {
            logger.debug("Skipping non-searchable field: {}", current.getName());
            continue;
        }
        propertyAccessors.add(current);
    }
    return this;
}
Also used : PropertyAccessor(com.manydesigns.elements.reflection.PropertyAccessor) Searchable(com.manydesigns.elements.annotations.Searchable)

Aggregations

Searchable (com.manydesigns.elements.annotations.Searchable)1 PropertyAccessor (com.manydesigns.elements.reflection.PropertyAccessor)1