/** * Add a new filter. * * @param filter the filter to be added. */ public synchronized void addFilter(Filter filter) { if (isReference()) { throw noChildrenAllowed(); } filters.addElement(filter); filterHash = null; }
/** * Create a new FiltersFile. * * @return The filtersfile that was created. */ public FiltersFile createFiltersfile() { if (isReference()) { throw noChildrenAllowed(); } return new FiltersFile(); }
/** * Adds the properties provided by the specified PropertySet to this filterset. * * @param propertySet the propertyset to be added to this propertyset */ public synchronized void addConfiguredPropertySet(PropertySet propertySet) { if (isReference()) { throw noChildrenAllowed(); } Properties p = propertySet.getProperties(); Set<Map.Entry<Object, Object>> entries = p.entrySet(); for (Map.Entry<Object, Object> entry : entries) { addFilter(new Filter(String.valueOf(entry.getKey()), String.valueOf(entry.getValue()))); } }
/** * Add a new filter made from the given token and value. * * @param token The token for the new filter. * @param value The value for the new filter. */ public synchronized void addFilter(String token, String value) { if (isReference()) { throw noChildrenAllowed(); } addFilter(new Filter(token, value)); }
/** * Add a Filterset to this filter set. * * @param filterSet the filterset to be added to this filterset */ public synchronized void addConfiguredFilterSet(FilterSet filterSet) { if (isReference()) { throw noChildrenAllowed(); } for (Filter filter : filterSet.getFilters()) { addFilter(filter); } }