/** * 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>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(); }