final List<String> urlMappingList, final Filter filter)
{
if (urlMappingList.size() > 0)
{
FilterMapping mapping = findFilterMapping(webApp, filter);
if (mapping == null)
{
mapping = WebFactory.eINSTANCE.createFilterMapping();
mapping.setFilterName(filter.getFilterName());
webApp.getFilterMappings().add(mapping);
}
// Add patterns
for (final String pattern : urlMappingList)
{
UrlPatternType urlPattern = JavaeeFactory.eINSTANCE
.createUrlPatternType();
urlPattern.setValue(pattern);
mapping.getUrlPatterns().add(urlPattern);
}
}
}