final List<String> urlMappingList, final Servlet servlet)
{
if (urlMappingList.size() > 0)
{
ServletMapping mapping = findServletMapping(webApp, servlet);
if (mapping == null)
{
mapping = WebFactory.eINSTANCE
.createServletMapping();
mapping.setServletName(servlet.getServletName());
webApp.getServletMappings().add(mapping);
}
// Add patterns
for (final String pattern : urlMappingList)
{
if (!(doesServletMappingPatternExist(webApp, servlet, pattern)))
{
UrlPatternType urlPattern = JavaeeFactory.eINSTANCE
.createUrlPatternType();
urlPattern.setValue(pattern);
mapping.getUrlPatterns().add(urlPattern);
}
}
}
}