Add a filter instance.

@param name   the filter's name
@param filter the filter instance
@return a {@link javax.servlet.FilterRegistration.Dynamic} instance allowing for further
configuration
510189
public FilterRegistration.Dynamic addFilter(String name, Filter filter) {
        return addFilter(name, new FilterHolder(requireNonNull(filter)));
    }
1096067
public VaadinForHeroku withFilterDefinition(final FilterDefinitionBuilder... filterDefs){
        checkVarArgsArguments(filterDefs);
        this.filterDefinitions.addAll(Arrays.asList(filterDefs));
        return self();
    }
1003626
public function addFilter(BuilderInterface $filter, $name = '')
    {
        if ($this->anonymous === false && empty($name)) {
            throw new \LogicException('In not anonymous filters filter name must be set.');
        } elseif ($this->anonymous === false && !empty($name)) {
            $this->filters['filters'][$name] = $filter->toArray();
        } else {
            $this->filters['filters'][] = $filter->toArray();
        }

        return $this;
    }
447212
public OrMessageFilter add(IFeedbackMessageFilter... filters) {
		for (IFeedbackMessageFilter filter : filters) {
			this.filters.add(filter);
		}
		return this;
	}
885785
public void addFilter(Filter filter, Object value) {
        if (filter.getParameterClass().isInstance(value)) {
           parameters.put(filter.repr(), value);
        } else {
            String msg = "You need to supply the correct parameter for the " +
                    filter + " filter. Expecting a(n) " + filter.getParameterClass().getSimpleName();
            throw new FilterParameterException(msg);
        }
    }
592776
public void addFilterBefore(IRuleFilter filter, Class<? extends IRuleFilter> beforeFilter) {
        int index = getIndexOfClass(filters, beforeFilter);
        if (index == -1) {
            throw new FilterAddException("filter " + beforeFilter.getSimpleName() + " has not been added");
        }
        filters.add(index, filter);
    }
430738
public CmsUrlNameMappingFilter filterName(String name) {

        if (name == null) {
            throw new IllegalArgumentException();
        }
        CmsUrlNameMappingFilter result = new CmsUrlNameMappingFilter(this);
        result.m_name = name;
        return result;
    }
993372
public function addFilter(AbstractQuery $filter, string $name = null): self
    {
        $filterArray = [];

        $type = self::NAMED_TYPE;

        if (null === $name) {
            $filterArray[] = $filter;
            $type = self::ANONYMOUS_TYPE;
        } else {
            $filterArray[$name] = $filter;
        }

        if ($this->hasParam('filters')
            && \count($this->getParam('filters'))
            && $this->_type !== $type
        ) {
            throw new InvalidException('Mix named and anonymous keys are not allowed');
        }

        $this->_type = $type;

        return $this->addParam('filters', $filterArray);
    }
1306775
static FilterImpl create(final String path, final Filter filter) {
        return create(path, DEFAULT_ACCEPT_TYPE, filter);
    }
1122927
public ServletRegistration.Dynamic addServlet(String name, Servlet servlet) {
        final ServletHolder holder = new NonblockingServletHolder(requireNonNull(servlet));
        holder.setName(name);
        handler.getServletHandler().addServlet(holder);

        final ServletRegistration.Dynamic registration = holder.getRegistration();
        checkDuplicateRegistration(name, servlets, "servlet");

        return registration;
    }
592246
@SuppressWarnings("unchecked")
  public <T extends RequestFilter> T requestFilter(String name) {
    return (T) requestFilters.get(name);
  }
10986
@SuppressWarnings("unchecked")
  public <T extends ResponseFilter> T responseFilter(String name) {
    return (T) responseFilters.get(name);
  }
576249
private FilterDescriptor createFilter(FilterType filterType, Map<String, FilterDescriptor> filters, ScannerContext context) {
        Store store = context.getStore();
        FilterDescriptor filterDescriptor = getOrCreateNamedDescriptor(FilterDescriptor.class, filterType.getFilterName().getValue(), filters, store);
        setAsyncSupported(filterDescriptor, filterType.getAsyncSupported());
        for (DescriptionType descriptionType : filterType.getDescription()) {
            filterDescriptor.getDescriptions().add(XmlDescriptorHelper.createDescription(descriptionType, store));
        }
        for (DisplayNameType displayNameType : filterType.getDisplayName()) {
            filterDescriptor.getDisplayNames().add(XmlDescriptorHelper.createDisplayName(displayNameType, store));
        }
        FullyQualifiedClassType filterClass = filterType.getFilterClass();
        if (filterClass != null) {
            TypeResolver typeResolver = context.peek(TypeResolver.class);
            TypeCache.CachedType<TypeDescriptor> filterClassDescriptor = typeResolver.resolve(filterClass.getValue(), context);
            filterDescriptor.setType(filterClassDescriptor.getTypeDescriptor());
        }
        for (IconType iconType : filterType.getIcon()) {
            IconDescriptor iconDescriptor = XmlDescriptorHelper.createIcon(iconType, store);
            filterDescriptor.getIcons().add(iconDescriptor);
        }
        for (ParamValueType paramValueType : filterType.getInitParam()) {
            ParamValueDescriptor paramValueDescriptor = createParamValue(paramValueType, store);
            filterDescriptor.getInitParams().add(paramValueDescriptor);
        }
        return filterDescriptor;
    }
659467
public void addParseFilter(ParseFilter filter) {
		log.debug("Loading parse filter: " + filter.getClass().getSimpleName());
		parseFilters.add(filter);
	}
320647
public void addFilter(PropFilter filter)
	{
		if (mFilter == null)
		{
			mFilter = new ArrayList<PropFilter>(8);
		}

		mFilter.add(filter);
	}
404978
public void addRequestFilter(String name, RequestFilter requestFilter) {
    if (isRequestFilterAdded(name)) {
      throw new IllegalArgumentException("Duplicate request filter: " + name);
    }
    proxy.addRequestFilter(requestFilter);
    requestFilters.put(name, requestFilter);
  }
435996
public function addFilter(FilterInterface $filter)
    {
        if ($this->hasFilter($filter->getName())) {
            throw new FilterAlreadyExistsException($filter->getName());
        }

        $this->filters[$filter->getName()] = $filter;
    }