Annotation Type PreFilter


@Retention(CLASS) @Target(METHOD) public @interface PreFilter

Removes the elements of a Collection or array argument for which the expression is false before the method runs, with filterObject bound to each element, as Spring Security's annotation of the same name does.

@PreFilter("filterObject.owner == authentication.name")
public void deleteAll(List<Document> documents) { ... }

A collection is filtered in place through its iterator, as Spring does, so it must be modifiable. An array is replaced by a shorter copy. With more than one such argument, filterTarget names the one to filter.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The expression, evaluated once per element.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The parameter to filter; needed only when more than one could be.
  • Element Details

    • value

      String value
      The expression, evaluated once per element.
    • filterTarget

      String filterTarget
      The parameter to filter; needed only when more than one could be.
      Default:
      ""