/** compare equals */ public boolean equals(Object obj) { if (obj instanceof ServletFilterMapping) { ServletFilterMapping o = (ServletFilterMapping) obj; Set<DispatcherType> otherDispatchers = o.getDispatchers(); boolean sameDispatchers = ( (dispatchers == null && (otherDispatchers == null || otherDispatchers.size() == 0)) || (dispatchers != null && dispatchers.equals(otherDispatchers)) ); if ( this.getName().equals(o.getName()) && this.getServletNames().equals(o.getServletNames()) && this.getURLPatterns().equals(o.getURLPatterns()) && sameDispatchers ) { return true; } } return false; }
protected void combineServletFilterMappings(WebBundleDescriptor webBundleDescriptor) { Map<String, ServletFilterMappingInfo> map = new HashMap<String, ServletFilterMappingInfo>(); for (ServletFilterMapping sfMapping : getServletFilterMappings()) { ServletFilterMappingInfo sfmInfo = map.get(sfMapping.getName()); if (sfmInfo == null) { sfmInfo = new ServletFilterMappingInfo(); sfmInfo.servletFilterMapping = sfMapping; map.put(sfMapping.getName(), sfmInfo); ServletFilterMappingInfo sfmInfo = map.get(sfMapping.getName()); if (sfmInfo != null) { if (!sfmInfo.hasMapping) {
/** * Configures this web module with the filter mappings specified in the * deployment descriptor. * * @param sfm The filter mappings of this web module as specified in the * deployment descriptor */ @SuppressWarnings({"unchecked"}) void addFilterMap(ServletFilterMapping sfm) { FilterMaps filterMaps = new FilterMaps(); filterMaps.setFilterName(sfm.getName()); filterMaps.setDispatcherTypes(sfm.getDispatchers()); List<String> servletNames = sfm.getServletNames(); if (servletNames != null) { for(String servletName : servletNames) { filterMaps.addServletName(servletName); } } List<String> urlPatterns = sfm.getURLPatterns(); if (urlPatterns != null) { for(String urlPattern : urlPatterns) { filterMaps.addURLPattern(urlPattern); } } addFilterMaps(filterMaps); }
if (filterName.equals(sfm.getName())) { servletFilterMappingDesc = sfm; hasUrlPattern = hasUrlPattern || (sfm.getURLPatterns().size() > 0);