public WebAppDescriptorImpl(String descriptorName, Node node) { super(descriptorName); this.model = node; addDefaultNamespaces(); }
/** * Adds the default namespaces as defined in the specification * @return the current instance of <code>WebAppDescriptor</code> */ public WebAppDescriptor addDefaultNamespaces() { addNamespace("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); addNamespace("xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"); addNamespace("xmlns", "http://java.sun.com/xml/ns/javaee"); return this; }
/** * If not already created, a new <code>icon</code> element will be created and returned. * Otherwise, the first existing <code>icon</code> element will be returned. * @return the instance defined for the element <code>icon</code> */ public IconType<WebAppDescriptor> getOrCreateIcon() { List<Node> nodeList = model.get("icon"); if (nodeList != null && nodeList.size() > 0) { return new IconTypeImpl<WebAppDescriptor>(this, "icon", model, nodeList.get(0)); } return createIcon(); }
/** * If not already created, a new <code>ejb-local-ref</code> element will be created and returned. * Otherwise, the first existing <code>ejb-local-ref</code> element will be returned. * @return the instance defined for the element <code>ejb-local-ref</code> */ public EjbLocalRefType<WebAppDescriptor> getOrCreateEjbLocalRef() { List<Node> nodeList = model.get("ejb-local-ref"); if (nodeList != null && nodeList.size() > 0) { return new EjbLocalRefTypeImpl<WebAppDescriptor>(this, "ejb-local-ref", model, nodeList.get(0)); } return createEjbLocalRef(); }
/** * If not already created, a new <code>servlet</code> element will be created and returned. * Otherwise, the first existing <code>servlet</code> element will be returned. * @return the instance defined for the element <code>servlet</code> */ public ServletType<WebAppDescriptor> getOrCreateServlet() { List<Node> nodeList = model.get("servlet"); if (nodeList != null && nodeList.size() > 0) { return new ServletTypeImpl<WebAppDescriptor>(this, "servlet", model, nodeList.get(0)); } return createServlet(); }
/** * If not already created, a new <code>locale-encoding-mapping-list</code> element will be created and returned. * Otherwise, the first existing <code>locale-encoding-mapping-list</code> element will be returned. * @return the instance defined for the element <code>locale-encoding-mapping-list</code> */ public LocaleEncodingMappingListType<WebAppDescriptor> getOrCreateLocaleEncodingMappingList() { List<Node> nodeList = model.get("locale-encoding-mapping-list"); if (nodeList != null && nodeList.size() > 0) { return new LocaleEncodingMappingListTypeImpl<WebAppDescriptor>(this, "locale-encoding-mapping-list", model, nodeList.get(0)); } return createLocaleEncodingMappingList(); }
/** * If not already created, a new <code>filter-mapping</code> element will be created and returned. * Otherwise, the first existing <code>filter-mapping</code> element will be returned. * @return the instance defined for the element <code>filter-mapping</code> */ public FilterMappingType<WebAppDescriptor> getOrCreateFilterMapping() { List<Node> nodeList = model.get("filter-mapping"); if (nodeList != null && nodeList.size() > 0) { return new FilterMappingTypeImpl<WebAppDescriptor>(this, "filter-mapping", model, nodeList.get(0)); } return createFilterMapping(); }
/** * If not already created, a new <code>persistence-unit-ref</code> element will be created and returned. * Otherwise, the first existing <code>persistence-unit-ref</code> element will be returned. * @return the instance defined for the element <code>persistence-unit-ref</code> */ public PersistenceUnitRefType<WebAppDescriptor> getOrCreatePersistenceUnitRef() { List<Node> nodeList = model.get("persistence-unit-ref"); if (nodeList != null && nodeList.size() > 0) { return new PersistenceUnitRefTypeImpl<WebAppDescriptor>(this, "persistence-unit-ref", model, nodeList.get(0)); } return createPersistenceUnitRef(); }
/** * If not already created, a new <code>pre-destroy</code> element will be created and returned. * Otherwise, the first existing <code>pre-destroy</code> element will be returned. * @return the instance defined for the element <code>pre-destroy</code> */ public LifecycleCallbackType<WebAppDescriptor> getOrCreatePreDestroy() { List<Node> nodeList = model.get("pre-destroy"); if (nodeList != null && nodeList.size() > 0) { return new LifecycleCallbackTypeImpl<WebAppDescriptor>(this, "pre-destroy", model, nodeList.get(0)); } return createPreDestroy(); }
/** * If not already created, a new <code>security-constraint</code> element will be created and returned. * Otherwise, the first existing <code>security-constraint</code> element will be returned. * @return the instance defined for the element <code>security-constraint</code> */ public SecurityConstraintType<WebAppDescriptor> getOrCreateSecurityConstraint() { List<Node> nodeList = model.get("security-constraint"); if (nodeList != null && nodeList.size() > 0) { return new SecurityConstraintTypeImpl<WebAppDescriptor>(this, "security-constraint", model, nodeList.get(0)); } return createSecurityConstraint(); }
/** * If not already created, a new <code>listener</code> element will be created and returned. * Otherwise, the first existing <code>listener</code> element will be returned. * @return the instance defined for the element <code>listener</code> */ public ListenerType<WebAppDescriptor> getOrCreateListener() { List<Node> nodeList = model.get("listener"); if (nodeList != null && nodeList.size() > 0) { return new ListenerTypeImpl<WebAppDescriptor>(this, "listener", model, nodeList.get(0)); } return createListener(); }
/** * If not already created, a new <code>env-entry</code> element will be created and returned. * Otherwise, the first existing <code>env-entry</code> element will be returned. * @return the instance defined for the element <code>env-entry</code> */ public EnvEntryType<WebAppDescriptor> getOrCreateEnvEntry() { List<Node> nodeList = model.get("env-entry"); if (nodeList != null && nodeList.size() > 0) { return new EnvEntryTypeImpl<WebAppDescriptor>(this, "env-entry", model, nodeList.get(0)); } return createEnvEntry(); }
/** * If not already created, a new <code>security-role</code> element will be created and returned. * Otherwise, the first existing <code>security-role</code> element will be returned. * @return the instance defined for the element <code>security-role</code> */ public SecurityRoleType<WebAppDescriptor> getOrCreateSecurityRole() { List<Node> nodeList = model.get("security-role"); if (nodeList != null && nodeList.size() > 0) { return new SecurityRoleTypeImpl<WebAppDescriptor>(this, "security-role", model, nodeList.get(0)); } return createSecurityRole(); }
/** * If not already created, a new <code>message-destination-ref</code> element will be created and returned. * Otherwise, the first existing <code>message-destination-ref</code> element will be returned. * @return the instance defined for the element <code>message-destination-ref</code> */ public MessageDestinationRefType<WebAppDescriptor> getOrCreateMessageDestinationRef() { List<Node> nodeList = model.get("message-destination-ref"); if (nodeList != null && nodeList.size() > 0) { return new MessageDestinationRefTypeImpl<WebAppDescriptor>(this, "message-destination-ref", model, nodeList.get(0)); } return createMessageDestinationRef(); }
public WebAppDescriptorImpl(String descriptorName, Node node) { super(descriptorName); this.model = node; addDefaultNamespaces(); }
/** * Adds the default namespaces as defined in the specification * @return the current instance of <code>WebAppDescriptor</code> */ public WebAppDescriptor addDefaultNamespaces() { addNamespace("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); addNamespace("xsi:schemaLocation", "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"); addNamespace("xmlns", "http://java.sun.com/xml/ns/javaee"); return this; }
/** * If not already created, a new <code>icon</code> element will be created and returned. * Otherwise, the first existing <code>icon</code> element will be returned. * @return the instance defined for the element <code>icon</code> */ public IconType<WebAppDescriptor> getOrCreateIcon() { List<Node> nodeList = model.get("icon"); if (nodeList != null && nodeList.size() > 0) { return new IconTypeImpl<WebAppDescriptor>(this, "icon", model, nodeList.get(0)); } return createIcon(); }
/** * If not already created, a new <code>ejb-local-ref</code> element will be created and returned. * Otherwise, the first existing <code>ejb-local-ref</code> element will be returned. * @return the instance defined for the element <code>ejb-local-ref</code> */ public EjbLocalRefType<WebAppDescriptor> getOrCreateEjbLocalRef() { List<Node> nodeList = model.get("ejb-local-ref"); if (nodeList != null && nodeList.size() > 0) { return new EjbLocalRefTypeImpl<WebAppDescriptor>(this, "ejb-local-ref", model, nodeList.get(0)); } return createEjbLocalRef(); }
/** * If not already created, a new <code>servlet</code> element will be created and returned. * Otherwise, the first existing <code>servlet</code> element will be returned. * @return the instance defined for the element <code>servlet</code> */ public ServletType<WebAppDescriptor> getOrCreateServlet() { List<Node> nodeList = model.get("servlet"); if (nodeList != null && nodeList.size() > 0) { return new ServletTypeImpl<WebAppDescriptor>(this, "servlet", model, nodeList.get(0)); } return createServlet(); }
/** * If not already created, a new <code>locale-encoding-mapping-list</code> element will be created and returned. * Otherwise, the first existing <code>locale-encoding-mapping-list</code> element will be returned. * @return the instance defined for the element <code>locale-encoding-mapping-list</code> */ public LocaleEncodingMappingListType<WebAppDescriptor> getOrCreateLocaleEncodingMappingList() { List<Node> nodeList = model.get("locale-encoding-mapping-list"); if (nodeList != null && nodeList.size() > 0) { return new LocaleEncodingMappingListTypeImpl<WebAppDescriptor>(this, "locale-encoding-mapping-list", model, nodeList.get(0)); } return createLocaleEncodingMappingList(); }