Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.impl
Class FacetFilter

java.lang.Object
  extended by org.nuxeo.ecm.core.api.impl.FacetFilter
All Implemented Interfaces:
Serializable, Filter

public class FacetFilter
extends Object
implements Filter

A filter based on facets.

Author:
Georges Racinet, Florent Guillaume
See Also:
Serialized Form

Field Summary
static FacetFilter ALLOW
           
 Set<String> excluded
          Set of excluded facets.
 Set<String> required
          Set of required facets.
 Boolean shortcut
           
 
Constructor Summary
FacetFilter(FacetFilter filter1, FacetFilter filter2)
          Constructor that ANDs two filters.
FacetFilter(List<String> required, List<String> excluded)
          Generic constructor.
FacetFilter(String facet, boolean isRequired)
          Simpler constructor to filter on a single facet.
 
Method Summary
 boolean accept(DocumentModel docModel)
          Filters data models objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW

public static final FacetFilter ALLOW

required

public final Set<String> required
Set of required facets. Never null.


excluded

public final Set<String> excluded
Set of excluded facets. Never null.


shortcut

public final Boolean shortcut
Constructor Detail

FacetFilter

public FacetFilter(List<String> required,
                   List<String> excluded)
Generic constructor.

Parameters:
required - list of facets the models must have to pass the filter
excluded - list of facets the models must not have to pass the filter

FacetFilter

public FacetFilter(String facet,
                   boolean isRequired)
Simpler constructor to filter on a single facet.

Parameters:
facet - the facet to filter on
isRequired - if true, accepted models must have the facet; if false, accepted models must not have the facet

FacetFilter

public FacetFilter(FacetFilter filter1,
                   FacetFilter filter2)
Constructor that ANDs two filters.

Parameters:
filter1 - the first filter
filter2 - the second filter
Method Detail

accept

public boolean accept(DocumentModel docModel)
Description copied from interface: Filter
Filters data models objects.

Specified by:
accept in interface Filter
Returns:
true if accepting the object false otherwise

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.