If not already created, a new <code>servlet-mapping</code> element will be created and returned.
Otherwise, the first existing <code>servlet-mapping</code> element will be returned.
@return the instance defined for the element <code>servlet-mapping</code>
180164
public ServletMappingType<WebAppDescriptor> getOrCreateServletMapping()
   {
      List<Node> nodeList = model.get("servlet-mapping");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ServletMappingTypeImpl<WebAppDescriptor>(this, "servlet-mapping", model, nodeList.get(0));
      }
      return createServletMapping();
   }
1060676
public WebType<ModuleType<T>> getOrCreateWeb()
   {
      Node node = childNode.getOrCreate("web");
      WebType<ModuleType<T>> web = new WebTypeImpl<ModuleType<T>>(this, "web", childNode, node);
      return web;
   }
98188
public BeanType<ValidationMappingDescriptor> getOrCreateBean()
   {
      List<Node> nodeList = model.get("bean");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new BeanTypeImpl<ValidationMappingDescriptor>(this, "bean", model, nodeList.get(0));
      }
      return createBean();
   }
591490
public Instance getInstance() {
        DescribeInstancesRequest req = new DescribeInstancesRequest();
        req.setInstanceIds(Collections.singleton(this.getInstanceId()));
        DescribeInstancesResult result = this.ec2Client.describeInstances(req);
        if (result.getReservations().size() != 1) {
            throw new IllegalStateException("Found multiple instances");
        }
        List<Instance> instances = result.getReservations().get(0).getInstances();
        if (instances.size() != 1) {
            throw new IllegalStateException("Found multiple instances");
        }
        return instances.get(0);
    }
274538
protected String newAlgorithm()
	{
		if (getModel().getAlgorithm() == null)
		{
			return SunJCEAlgorithm.PBEWithMD5AndDES.getAlgorithm();
		}
		return getModel().getAlgorithm().getAlgorithm();
	}
526298
public LinkedHashMap<String, CmsContainerElementBean> getNewElementsInOrder() {

        LinkedHashMap<String, CmsContainerElementBean> result = new LinkedHashMap<String, CmsContainerElementBean>();
        if (m_ordering != null) {
            for (String orderKey : m_ordering) {
                CmsContainerElementBean element = m_newElements.get(orderKey);
                if (element != null) {
                    result.put(orderKey, element);
                }
            }
            return result;
        }
        return new LinkedHashMap<String, CmsContainerElementBean>();
    }
344858
public FilterMappingType<WebAppType<T>> getOrCreateFilterMapping()
   {
      List<Node> nodeList = childNode.get("filter-mapping");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FilterMappingTypeImpl<WebAppType<T>>(this, "filter-mapping", childNode, nodeList.get(0));
      }
      return createFilterMapping();
   }
926403
public static ServletContainer defaultContainer() {
        if (container != null) {
            return container;
        }
        synchronized (Servlets.class) {
            if (container != null) {
                return container;
            }
            return container = ServletContainer.Factory.newInstance();
        }
    }
217121
protected Marshaller getOrCreateMarshaller() {

    try {
      Marshaller marshaller = this.jaxbContext.createMarshaller();
      marshaller.setEventHandler(this);
      return marshaller;
    } catch (JAXBException e) {
      throw new IllegalStateException(e);
    }
  }
919711
public static ServletInfo servlet(final String name, final Class<? extends Servlet> servletClass, final InstanceFactory<? extends Servlet> servlet) {
        return new ServletInfo(name, servletClass, servlet);
    }
643230
public AnnotationType<ElementType<T>> getOrCreateAnnotation()
   {
      List<Node> nodeList = childNode.get("annotation");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new AnnotationTypeImpl<ElementType<T>>(this, "annotation", childNode, nodeList.get(0));
      }
      return createAnnotation();
   }
717452
protected Unmarshaller getOrCreateUnmarshaller() {

    try {
      Unmarshaller unmarshaller = this.jaxbContext.createUnmarshaller();
      unmarshaller.setEventHandler(this);
      try {
        unmarshaller.setProperty(com.sun.xml.internal.bind.IDResolver.class.getName(), new InternalValidatingIdResolver());
      } catch (Throwable e) {
        try {
          LOG.debug("No default JAXB implementation found ({0})- trying jaxb-impl (com.sun.xml.bind).", e.toString());
          unmarshaller.setProperty("com.sun.xml.bind.IDResolver", new ExternalValidatingIdResolver());
        } catch (Exception e2) {
          LOG.error("ID-validation will not work! Please check your JAXB implementation!", e2);
        }
      }
      return unmarshaller;
    } catch (JAXBException e) {
      throw new IllegalStateException(e);
    }
  }
1039967
private ServletDescriptor createServlet(ServletType servletType, Map<String, ServletDescriptor> servlets, ScannerContext context) {
        Store store = context.getStore();
        ServletDescriptor servletDescriptor = getOrCreateNamedDescriptor(ServletDescriptor.class, servletType.getServletName().getValue(), servlets, store);
        setAsyncSupported(servletDescriptor, servletType.getAsyncSupported());
        for (DescriptionType descriptionType : servletType.getDescription()) {
            servletDescriptor.getDescriptions().add(XmlDescriptorHelper.createDescription(descriptionType, store));
        }
        for (DisplayNameType displayNameType : servletType.getDisplayName()) {
            servletDescriptor.getDisplayNames().add(XmlDescriptorHelper.createDisplayName(displayNameType, store));
        }
        TrueFalseType enabled = servletType.getEnabled();
        if (enabled != null) {
            servletDescriptor.setEnabled(enabled.isValue());
        }
        for (IconType iconType : servletType.getIcon()) {
            IconDescriptor iconDescriptor = XmlDescriptorHelper.createIcon(iconType, store);
            servletDescriptor.getIcons().add(iconDescriptor);
        }
        for (ParamValueType paramValueType : servletType.getInitParam()) {
            ParamValueDescriptor paramValueDescriptor = createParamValue(paramValueType, store);
            servletDescriptor.getInitParams().add(paramValueDescriptor);
        }
        JspFileType jspFile = servletType.getJspFile();
        if (jspFile != null) {
            servletDescriptor.setJspFile(jspFile.getValue());
        }
        String loadOnStartup = servletType.getLoadOnStartup();
        if (loadOnStartup != null) {
            servletDescriptor.setLoadOnStartup(loadOnStartup.toUpperCase());
        }
        MultipartConfigType multipartConfig = servletType.getMultipartConfig();
        if (multipartConfig != null) {
            MultipartConfigDescriptor multipartConfigDescriptor = store.create(MultipartConfigDescriptor.class);
            BigInteger fileSizeThreshold = multipartConfig.getFileSizeThreshold();
            if (fileSizeThreshold != null) {
                multipartConfigDescriptor.setFileSizeThreshold(fileSizeThreshold.longValue());
            }
            multipartConfigDescriptor.setLocation(multipartConfig.getLocation());
            multipartConfigDescriptor.setMaxFileSize(multipartConfig.getMaxFileSize());
            multipartConfigDescriptor.setMaxRequestSize(multipartConfig.getMaxRequestSize());
            servletDescriptor.setMultipartConfig(multipartConfigDescriptor);
        }
        RunAsType runAs = servletType.getRunAs();
        if (runAs != null) {
            RunAsDescriptor runAsDescriptor = store.create(RunAsDescriptor.class);
            for (DescriptionType descriptionType : runAs.getDescription()) {
                DescriptionDescriptor descriptionDescriptor = XmlDescriptorHelper.createDescription(descriptionType, store);
                runAsDescriptor.getDescriptions().add(descriptionDescriptor);
            }
            RoleNameType roleName = runAs.getRoleName();
            if (roleName != null) {
                runAsDescriptor.setRoleName(roleName.getValue());
            }
            servletDescriptor.setRunAs(runAsDescriptor);
        }
        for (SecurityRoleRefType securityRoleRefType : servletType.getSecurityRoleRef()) {
            SecurityRoleRefDescriptor securityRoleRefDescriptor = store.create(SecurityRoleRefDescriptor.class);
            securityRoleRefDescriptor.setRoleName(securityRoleRefType.getRoleName().getValue());
            for (DescriptionType descriptionType : securityRoleRefType.getDescription()) {
                DescriptionDescriptor descriptionDescriptor = XmlDescriptorHelper.createDescription(descriptionType, store);
                securityRoleRefDescriptor.getDescriptions().add(descriptionDescriptor);
            }
            RoleNameType roleLink = securityRoleRefType.getRoleLink();
            if (roleLink != null) {
                securityRoleRefDescriptor.setRoleLink(roleLink.getValue());
            }
            servletDescriptor.getSecurityRoleRefs().add(securityRoleRefDescriptor);
        }
        FullyQualifiedClassType servletClass = servletType.getServletClass();
        if (servletClass != null) {
            TypeCache.CachedType<TypeDescriptor> servletClassType = context.peek(TypeResolver.class).resolve(servletClass.getValue(), context);
            servletDescriptor.setType(servletClassType.getTypeDescriptor());
        }
        return servletDescriptor;
    }
39947
public Object getInstanceOf(String key){

			try {
				ClassLoader loader = Thread.currentThread().getContextClassLoader();

				return Class.forName((String)classesMap.get(key),true,loader).newInstance();

			} catch (IllegalAccessException e) {
				logger.logp(Level.SEVERE,"JspClassFactory","getInstanceOf","jsp.error.function.classnotfound",(String) classesMap.get(key));
			} catch (InstantiationException e) {
				logger.logp(Level.SEVERE,"JspClassFactory","getInstanceOf","jsp.error.function.classnotfound",(String) classesMap.get(key));
			} catch (ClassNotFoundException e) {
				logger.logp(Level.SEVERE,"JspClassFactory","getInstanceOf","jsp.error.function.classnotfound",(String) classesMap.get(key));
			}
			return null;
	}
149194
public Object previous() {
        Object element = null;
        if (previousElement != null) {
            element = previousElement;
            previousElement = null;
        } else {
            element = getPreviousElement();
            if (element == null) {
                throw new java.util.NoSuchElementException();
            }
        }
        return element;
    }
671702
public ClassType<BeanType<T>> getOrCreateClazz()
   {
      Node node = childNode.getOrCreate("class");
      ClassType<BeanType<T>> clazz = new ClassTypeImpl<BeanType<T>>(this, "class", childNode, node);
      return clazz;
   }
1310322
public JspConfigType<WebAppType<T>> getOrCreateJspConfig()
   {
      List<Node> nodeList = childNode.get("jsp-config");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new JspConfigTypeImpl<WebAppType<T>>(this, "jsp-config", childNode, nodeList.get(0));
      }
      return createJspConfig();
   }