Constructing filters with variable length criterias

Just implemented the new Container.Filter using this code:

Filter f  = new Or(new SimpleStringFilter(, "rpm-diastolic", true, false) , new Or(new SimpleStringFilter(, "rpm-systolic", true, false))
				,new Or(new SimpleStringFilter(, "rpm-weight", true, false))) ;

and works fine.

Now I would like to use the following in order to build as many criterias I would need by building dynamically the filter:

List<String> filters;
for(String filter : filters) {
				Filter f  = new Or(new SimpleStringFilter(, filter, true, false) );

How can I do this for this code doesn’t work…

Hi Patrick,

what about this:

List<String> filterNames;
List<Filter> filters;
for(String filter : filterNames) {
    filters.add(new SimpleStringFilter(, filter, true, false) );
container.addContainerFilter(new Or(filters.toArray(new Filter[filters.size()]