public abstract class Filter extends Object
The FormalModule.getViewObjects()
method returns the list of objects visible in the current view set on the module. If "Standard view"
is set, the list contains all objects of the module. If a custom view is set, the list of objects might be filtered (i.e. might not contain all
objects), according to the filters defined in the view.
A Filter instance introduces additional filtering on top on the one provided by the current view. It can exclude objects that were accepted by the current view native filters. It cannot be used to reveal an object natively filtered by the current view.
A dynamic filter is defined for a specific module, using an ItemScope
instance.
Dynamic filtering supports the following criteria:
Multiple criteria might be combined into one dynamic filter, for example to restrict the list of objects to the one modified after a certain date and having a specific value in an attribute.
Below is a snippet illustrating how to use a filter when reading a module:
Filter filter = Filter.builder().contains("Object Text", "shall", false).build(); ReaderScope scope = new ReaderScope(); scope.getItemScope(myModuleQualifiedName).setFilter(filter); Map<String, Object> options = new HashMap<String, Object>(); options.put(Common.OPTION_SCOPE, scope); model.read("Application", "", options);
This class is not intended to be subclassed by clients. Instances shall be obtained using the builder()
method.
ItemScope.setFilter(Filter)
,
FormalModule.getViewObjects()
Modifier and Type | Class and Description |
---|---|
static interface |
Filter.Builder
Enables to define and combine filtering criteria.
|
Modifier | Constructor and Description |
---|---|
protected |
Filter()
Clients should not use this constructor.
|
Modifier and Type | Method and Description |
---|---|
static Filter.Builder |
builder()
Create a
Builder instance, to define filtering criteria and instantiate a Filter . |
public static Filter.Builder builder()
Builder
instance, to define filtering criteria and instantiate a Filter
.