/** * Adds the default namespaces as defined in the specification * @return the current instance of <code>WebFragmentDescriptor</code> */ public WebFragmentDescriptor 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-fragment_3_0.xsd"); addNamespace("xmlns", "http://java.sun.com/xml/ns/javaee"); return this; }
public WebFragmentDescriptorImpl(String descriptorName, Node node) { super(descriptorName); this.model = node; addDefaultNamespaces(); }
/** * 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<WebFragmentDescriptor> getOrCreateListener() { List<Node> nodeList = model.get("listener"); if (nodeList != null && nodeList.size() > 0) { return new ListenerTypeImpl<WebFragmentDescriptor>(this, "listener", model, nodeList.get(0)); } return createListener(); }
/** * 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> */ public ServletMappingType<WebFragmentDescriptor> getOrCreateServletMapping() { List<Node> nodeList = model.get("servlet-mapping"); if (nodeList != null && nodeList.size() > 0) { return new ServletMappingTypeImpl<WebFragmentDescriptor>(this, "servlet-mapping", model, nodeList.get(0)); } return createServletMapping(); }
/** * If not already created, a new <code>resource-env-ref</code> element will be created and returned. * Otherwise, the first existing <code>resource-env-ref</code> element will be returned. * @return the instance defined for the element <code>resource-env-ref</code> */ public ResourceEnvRefType<WebFragmentDescriptor> getOrCreateResourceEnvRef() { List<Node> nodeList = model.get("resource-env-ref"); if (nodeList != null && nodeList.size() > 0) { return new ResourceEnvRefTypeImpl<WebFragmentDescriptor>(this, "resource-env-ref", model, nodeList.get(0)); } return createResourceEnvRef(); }
/** * If not already created, a new <code>service-ref</code> element will be created and returned. * Otherwise, the first existing <code>service-ref</code> element will be returned. * @return the instance defined for the element <code>service-ref</code> */ public ServiceRefType<WebFragmentDescriptor> getOrCreateServiceRef() { List<Node> nodeList = model.get("service-ref"); if (nodeList != null && nodeList.size() > 0) { return new ServiceRefTypeImpl<WebFragmentDescriptor>(this, "service-ref", model, nodeList.get(0)); } return createServiceRef(); }
/** * 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<WebFragmentDescriptor> getOrCreateSecurityConstraint() { List<Node> nodeList = model.get("security-constraint"); if (nodeList != null && nodeList.size() > 0) { return new SecurityConstraintTypeImpl<WebFragmentDescriptor>(this, "security-constraint", model, nodeList.get(0)); } return createSecurityConstraint(); }
/** * 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<WebFragmentDescriptor> getOrCreateSecurityRole() { List<Node> nodeList = model.get("security-role"); if (nodeList != null && nodeList.size() > 0) { return new SecurityRoleTypeImpl<WebFragmentDescriptor>(this, "security-role", model, nodeList.get(0)); } return createSecurityRole(); }
/** * If not already created, a new <code>post-construct</code> element will be created and returned. * Otherwise, the first existing <code>post-construct</code> element will be returned. * @return the instance defined for the element <code>post-construct</code> */ public LifecycleCallbackType<WebFragmentDescriptor> getOrCreatePostConstruct() { List<Node> nodeList = model.get("post-construct"); if (nodeList != null && nodeList.size() > 0) { return new LifecycleCallbackTypeImpl<WebFragmentDescriptor>(this, "post-construct", model, nodeList.get(0)); } return createPostConstruct(); }
/** * 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<WebFragmentDescriptor> getOrCreateDataSource() { List<Node> nodeList = model.get("data-source"); if (nodeList != null && nodeList.size() > 0) { return new DataSourceTypeImpl<WebFragmentDescriptor>(this, "data-source", model, nodeList.get(0)); } return createDataSource(); }
/** * If not already created, a new <code>ordering</code> element will be created and returned. * Otherwise, the first existing <code>ordering</code> element will be returned. * @return the instance defined for the element <code>ordering</code> */ public OrderingType<WebFragmentDescriptor> getOrCreateOrdering() { List<Node> nodeList = model.get("ordering"); if (nodeList != null && nodeList.size() > 0) { return new OrderingTypeImpl<WebFragmentDescriptor>(this, "ordering", model, nodeList.get(0)); } return createOrdering(); }
/** * If not already created, a new <code>persistence-context-ref</code> element will be created and returned. * Otherwise, the first existing <code>persistence-context-ref</code> element will be returned. * @return the instance defined for the element <code>persistence-context-ref</code> */ public PersistenceContextRefType<WebFragmentDescriptor> getOrCreatePersistenceContextRef() { List<Node> nodeList = model.get("persistence-context-ref"); if (nodeList != null && nodeList.size() > 0) { return new PersistenceContextRefTypeImpl<WebFragmentDescriptor>(this, "persistence-context-ref", model, nodeList.get(0)); } return createPersistenceContextRef(); }
/** * 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<WebFragmentDescriptor> getOrCreateFilterMapping() { List<Node> nodeList = model.get("filter-mapping"); if (nodeList != null && nodeList.size() > 0) { return new FilterMappingTypeImpl<WebFragmentDescriptor>(this, "filter-mapping", model, nodeList.get(0)); } return createFilterMapping(); }
/** * 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<WebFragmentDescriptor> getOrCreateEjbRef() { List<Node> nodeList = model.get("ejb-ref"); if (nodeList != null && nodeList.size() > 0) { return new EjbRefTypeImpl<WebFragmentDescriptor>(this, "ejb-ref", model, nodeList.get(0)); } return createEjbRef(); }
/** * If not already created, a new <code>login-config</code> element will be created and returned. * Otherwise, the first existing <code>login-config</code> element will be returned. * @return the instance defined for the element <code>login-config</code> */ public LoginConfigType<WebFragmentDescriptor> getOrCreateLoginConfig() { List<Node> nodeList = model.get("login-config"); if (nodeList != null && nodeList.size() > 0) { return new LoginConfigTypeImpl<WebFragmentDescriptor>(this, "login-config", model, nodeList.get(0)); } return createLoginConfig(); }
/** * Adds the default namespaces as defined in the specification * @return the current instance of <code>WebFragmentDescriptor</code> */ public WebFragmentDescriptor 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-fragment_3_0.xsd"); addNamespace("xmlns", "http://java.sun.com/xml/ns/javaee"); return this; }
public WebFragmentDescriptorImpl(String descriptorName, Node node) { super(descriptorName); this.model = node; addDefaultNamespaces(); }
/** * 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> */ public ServletMappingType<WebFragmentDescriptor> getOrCreateServletMapping() { List<Node> nodeList = model.get("servlet-mapping"); if (nodeList != null && nodeList.size() > 0) { return new ServletMappingTypeImpl<WebFragmentDescriptor>(this, "servlet-mapping", model, nodeList.get(0)); } return createServletMapping(); }
/** * If not already created, a new <code>resource-env-ref</code> element will be created and returned. * Otherwise, the first existing <code>resource-env-ref</code> element will be returned. * @return the instance defined for the element <code>resource-env-ref</code> */ public ResourceEnvRefType<WebFragmentDescriptor> getOrCreateResourceEnvRef() { List<Node> nodeList = model.get("resource-env-ref"); if (nodeList != null && nodeList.size() > 0) { return new ResourceEnvRefTypeImpl<WebFragmentDescriptor>(this, "resource-env-ref", model, nodeList.get(0)); } return createResourceEnvRef(); }
/** * If not already created, a new <code>service-ref</code> element will be created and returned. * Otherwise, the first existing <code>service-ref</code> element will be returned. * @return the instance defined for the element <code>service-ref</code> */ public ServiceRefType<WebFragmentDescriptor> getOrCreateServiceRef() { List<Node> nodeList = model.get("service-ref"); if (nodeList != null && nodeList.size() > 0) { return new ServiceRefTypeImpl<WebFragmentDescriptor>(this, "service-ref", model, nodeList.get(0)); } return createServiceRef(); }