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_2_5.xsd"); addNamespace("xmlns", "http://java.sun.com/xml/ns/javaee"); return this; }
/** * If not already created, a new <code>context-param</code> element will be created and returned. * Otherwise, the first existing <code>context-param</code> element will be returned. * @return the instance defined for the element <code>context-param</code> */ public ParamValueType<WebAppDescriptor> getOrCreateContextParam() { List<Node> nodeList = model.get("context-param"); if (nodeList != null && nodeList.size() > 0) { return new ParamValueTypeImpl<WebAppDescriptor>(this, "context-param", model, nodeList.get(0)); } return createContextParam(); }
/** * If not already created, a new <code>ejb-ref</code> element will be created and returned. * Otherwise, the first existing <code>ejb-ref</code> element will be returned. * @return the instance defined for the element <code>ejb-ref</code> */ public EjbRefType<WebAppDescriptor> getOrCreateEjbRef() { List<Node> nodeList = model.get("ejb-ref"); if (nodeList != null && nodeList.size() > 0) { return new EjbRefTypeImpl<WebAppDescriptor>(this, "ejb-ref", model, nodeList.get(0)); } return createEjbRef(); }
/** * 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>error-page</code> element will be created and returned. * Otherwise, the first existing <code>error-page</code> element will be returned. * @return the instance defined for the element <code>error-page</code> */ public ErrorPageType<WebAppDescriptor> getOrCreateErrorPage() { List<Node> nodeList = model.get("error-page"); if (nodeList != null && nodeList.size() > 0) { return new ErrorPageTypeImpl<WebAppDescriptor>(this, "error-page", model, nodeList.get(0)); } return createErrorPage(); }
/** * If not already created, a new <code>filter</code> element will be created and returned. * Otherwise, the first existing <code>filter</code> element will be returned. * @return the instance defined for the element <code>filter</code> */ public FilterType<WebAppDescriptor> getOrCreateFilter() { List<Node> nodeList = model.get("filter"); if (nodeList != null && nodeList.size() > 0) { return new FilterTypeImpl<WebAppDescriptor>(this, "filter", model, nodeList.get(0)); } return createFilter(); }
/** * 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>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>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>context-param</code> element will be created and returned. * Otherwise, the first existing <code>context-param</code> element will be returned. * @return the instance defined for the element <code>context-param</code> */ public ParamValueType<WebAppDescriptor> getOrCreateContextParam() { List<Node> nodeList = model.get("context-param"); if (nodeList != null && nodeList.size() > 0) { return new ParamValueTypeImpl<WebAppDescriptor>(this, "context-param", model, nodeList.get(0)); } return createContextParam(); }
/** * If not already created, a new <code>ejb-ref</code> element will be created and returned. * Otherwise, the first existing <code>ejb-ref</code> element will be returned. * @return the instance defined for the element <code>ejb-ref</code> */ public EjbRefType<WebAppDescriptor> getOrCreateEjbRef() { List<Node> nodeList = model.get("ejb-ref"); if (nodeList != null && nodeList.size() > 0) { return new EjbRefTypeImpl<WebAppDescriptor>(this, "ejb-ref", model, nodeList.get(0)); } return createEjbRef(); }
/** * 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>error-page</code> element will be created and returned. * Otherwise, the first existing <code>error-page</code> element will be returned. * @return the instance defined for the element <code>error-page</code> */ public ErrorPageType<WebAppDescriptor> getOrCreateErrorPage() { List<Node> nodeList = model.get("error-page"); if (nodeList != null && nodeList.size() > 0) { return new ErrorPageTypeImpl<WebAppDescriptor>(this, "error-page", model, nodeList.get(0)); } return createErrorPage(); }
/** * If not already created, a new <code>filter</code> element will be created and returned. * Otherwise, the first existing <code>filter</code> element will be returned. * @return the instance defined for the element <code>filter</code> */ public FilterType<WebAppDescriptor> getOrCreateFilter() { List<Node> nodeList = model.get("filter"); if (nodeList != null && nodeList.size() > 0) { return new FilterTypeImpl<WebAppDescriptor>(this, "filter", model, nodeList.get(0)); } return createFilter(); }
/** * 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>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>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(); }
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_2_5.xsd"); addNamespace("xmlns", "http://java.sun.com/xml/ns/javaee"); return this; }