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://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"); addNamespace("xmlns", "http://xmlns.jcp.org/xml/ns/javaee"); return this; }
/** * 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>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>data-source</code> element will be created and returned. * Otherwise, the first existing <code>data-source</code> element will be returned. * @return the instance defined for the element <code>data-source</code> */ public DataSourceType<WebAppDescriptor> getOrCreateDataSource() { List<Node> nodeList = model.get("data-source"); if (nodeList != null && nodeList.size() > 0) { return new DataSourceTypeImpl<WebAppDescriptor>(this, "data-source", model, nodeList.get(0)); } return createDataSource(); }
/** * 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>absolute-ordering</code> element will be created and returned. * Otherwise, the first existing <code>absolute-ordering</code> element will be returned. * @return the instance defined for the element <code>absolute-ordering</code> */ public AbsoluteOrderingType<WebAppDescriptor> getOrCreateAbsoluteOrdering() { List<Node> nodeList = model.get("absolute-ordering"); if (nodeList != null && nodeList.size() > 0) { return new AbsoluteOrderingTypeImpl<WebAppDescriptor>(this, "absolute-ordering", model, nodeList.get(0)); } return createAbsoluteOrdering(); }
/** * 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>connection-factory</code> element will be created and returned. * Otherwise, the first existing <code>connection-factory</code> element will be returned. * @return the instance defined for the element <code>connection-factory</code> */ public ConnectionFactoryResourceType<WebAppDescriptor> getOrCreateConnectionFactory() { List<Node> nodeList = model.get("connection-factory"); if (nodeList != null && nodeList.size() > 0) { return new ConnectionFactoryResourceTypeImpl<WebAppDescriptor>(this, "connection-factory", model, nodeList.get(0)); } return createConnectionFactory(); }
/** * If not already created, a new <code>administered-object</code> element will be created and returned. * Otherwise, the first existing <code>administered-object</code> element will be returned. * @return the instance defined for the element <code>administered-object</code> */ public AdministeredObjectType<WebAppDescriptor> getOrCreateAdministeredObject() { List<Node> nodeList = model.get("administered-object"); if (nodeList != null && nodeList.size() > 0) { return new AdministeredObjectTypeImpl<WebAppDescriptor>(this, "administered-object", model, nodeList.get(0)); } return createAdministeredObject(); }
/** * 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>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>data-source</code> element will be created and returned. * Otherwise, the first existing <code>data-source</code> element will be returned. * @return the instance defined for the element <code>data-source</code> */ public DataSourceType<WebAppDescriptor> getOrCreateDataSource() { List<Node> nodeList = model.get("data-source"); if (nodeList != null && nodeList.size() > 0) { return new DataSourceTypeImpl<WebAppDescriptor>(this, "data-source", model, nodeList.get(0)); } return createDataSource(); }
/** * 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>absolute-ordering</code> element will be created and returned. * Otherwise, the first existing <code>absolute-ordering</code> element will be returned. * @return the instance defined for the element <code>absolute-ordering</code> */ public AbsoluteOrderingType<WebAppDescriptor> getOrCreateAbsoluteOrdering() { List<Node> nodeList = model.get("absolute-ordering"); if (nodeList != null && nodeList.size() > 0) { return new AbsoluteOrderingTypeImpl<WebAppDescriptor>(this, "absolute-ordering", model, nodeList.get(0)); } return createAbsoluteOrdering(); }
/** * 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>connection-factory</code> element will be created and returned. * Otherwise, the first existing <code>connection-factory</code> element will be returned. * @return the instance defined for the element <code>connection-factory</code> */ public ConnectionFactoryResourceType<WebAppDescriptor> getOrCreateConnectionFactory() { List<Node> nodeList = model.get("connection-factory"); if (nodeList != null && nodeList.size() > 0) { return new ConnectionFactoryResourceTypeImpl<WebAppDescriptor>(this, "connection-factory", model, nodeList.get(0)); } return createConnectionFactory(); }
/** * If not already created, a new <code>administered-object</code> element will be created and returned. * Otherwise, the first existing <code>administered-object</code> element will be returned. * @return the instance defined for the element <code>administered-object</code> */ public AdministeredObjectType<WebAppDescriptor> getOrCreateAdministeredObject() { List<Node> nodeList = model.get("administered-object"); if (nodeList != null && nodeList.size() > 0) { return new AdministeredObjectTypeImpl<WebAppDescriptor>(this, "administered-object", model, nodeList.get(0)); } return createAdministeredObject(); }
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://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"); addNamespace("xmlns", "http://xmlns.jcp.org/xml/ns/javaee"); return this; }