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>
488108
public DataSourceType<WebFragmentType<T>> getOrCreateDataSource()
   {
      List<Node> nodeList = childNode.get("data-source");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new DataSourceTypeImpl<WebFragmentType<T>>(this, "data-source", childNode, nodeList.get(0));
      }
      return createDataSource();
   }
46648
public static <T> Source<T> empty() {
        return new AbstractSource<T>() {
            @Override
            public T computeNext() {
                return endOfData();
            }
        };
    }
1135501
public <T extends DataSource> T getDataSource() {
        T dataSource = jndiLookup(PropertyKey.DATA_SOURCE_JNDI_NAME);
        if (dataSource != null) {
            return dataSource;
        }
        dataSource = instantiateClass(PropertyKey.DATA_SOURCE_CLASS_NAME);
        if (dataSource == null) {
            throw new IllegalArgumentException("The " + PropertyKey.DATA_SOURCE_CLASS_NAME + " property is mandatory!");
        }
        return applyDataSourceProperties(dataSource);
    }
713394
public String getSource()
	{
		final Element element = getElement("Source", 0);

		if (element != null)
			return element.getText();
		else
			return null;
	}
1357060
public DataSource getDataSource() {
        if(dataSource == null) {
            LOG.info("Having to construct a new DataSource");

            dataSource = new DataSource();

            dataSource.setDriverClassName(dbSettings.getDriver());
            dataSource.setUrl(dbSettings.getJdbcUrl());
            dataSource.setUsername(dbSettings.getUser());
            dataSource.setPassword(dbSettings.getPass());

            dataSource.setMaxActive(dbSettings.getMaxActive());
            dataSource.setMaxIdle(dbSettings.getMaxIdle());
            dataSource.setMinIdle(dbSettings.getMinIdle());
            dataSource.setInitialSize(dbSettings.getInitialSize());
            dataSource.setTestOnBorrow(dbSettings.getTestOnBorrow());
            dataSource.setTestOnReturn(dbSettings.getTestOnReturn());
            dataSource.setTestWhileIdle(dbSettings.getTestWhileIdle());
            dataSource.setValidationQuery(dbSettings.getValidationQuery());
            dataSource.setLogValidationErrors(dbSettings.getLogValidationErrors());

            // a catch-all for any other properties that are needed
            dataSource.setDbProperties(dbSettings.getProperties());
        }

        return dataSource;
    }
1318061
public FacesConfigFlowDefinitionSwitchType<FacesConfigFlowDefinitionType<T>> getOrCreateSwitch()
   {
      List<Node> nodeList = childNode.get("switch");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigFlowDefinitionSwitchTypeImpl<FacesConfigFlowDefinitionType<T>>(this, "switch", childNode, nodeList.get(0));
      }
      return createSwitch();
   }
1233147
@Override
    public ClustreamClustererAdapter create() {
        ClustreamClustererAdapter l = new ClustreamClustererAdapter(learner, dataset);
        if (dataset == null) {
            System.out.println("dataset null while creating");
        }
        return l;
    }
1188225
private Object getPreviousElement() {
        Object element = null;
        while (currentIndex >= startIndex && element == null) {
            currentIndex--;
            element = getElement();
        }
        return element;
    }
968313
public Convert<Basic<T>> getOrCreateConvert()
   {
      Node node = childNode.getOrCreate("convert");
      Convert<Basic<T>> convert = new ConvertImpl<Basic<T>>(this, "convert", childNode, node);
      return convert;
   }
702235
public PartialResponseDeleteType<PartialResponseChangesType<T>> getOrCreateDelete()
   {
      List<Node> nodeList = childNode.get("delete");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new PartialResponseDeleteTypeImpl<PartialResponseChangesType<T>>(this, "delete", childNode, nodeList.get(0));
      }
      return createDelete();
   }
718208
public Element cloneSvgElement(Element source) {
		if (source == null || source.getNodeName() == null) {
			return null;
		}
		if ("#text".equals(source.getNodeName())) {
			return Document.get().createTextNode(source.getNodeValue()).cast();
		}
		Element clone = createElementNS(Dom.NS_SVG, source.getNodeName(), Dom.createUniqueId());
		cloneAttributes(source, clone);
		for (int i = 0; i < source.getChildCount(); i++) {
			Element child = source.getChild(i).cast();
			clone.appendChild(cloneSvgElement(child));
		}

		return clone;
	}
464596
public Dissector getNewInstance() {
        try {
            Constructor<? extends Dissector> co = this.getClass().getConstructor();
            Dissector newInstance = co.newInstance();
            initializeNewInstance(newInstance);
            return newInstance;
        } catch (Exception e) {
            LOG.error("Unable to create instance of {}: {}", this.getClass().getCanonicalName(), e);
        }
        return null;
    }
660734
public EjbLocalRefType<WebFragmentType<T>> getOrCreateEjbLocalRef()
   {
      List<Node> nodeList = childNode.get("ejb-local-ref");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new EjbLocalRefTypeImpl<WebFragmentType<T>>(this, "ejb-local-ref", childNode, nodeList.get(0));
      }
      return createEjbLocalRef();
   }
1335177
private T getOrCreate() throws E {
    try {
      T client = elements.poll();
      // a client was available, all good. otherwise, create one
      if (client != null) {
        return client;
      }
      return create();
    } catch (Exception e) {
      // if an exception is thrown after acquiring the semaphore, release the
      // semaphore before propagating the exception
      semaphore.release();
      throw e;
    }
  }
88659
public Decision<JobXMLDescriptor> getOrCreateDecision()
   {
      List<Node> nodeList = model.get("decision");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new DecisionImpl<JobXMLDescriptor>(this, "decision", model, nodeList.get(0));
      }
      return createDecision();
   }
34352
function(element, options) {
      var options = options || {}
      if (element.length) {
        return this.createAll(options, element);
      } else {
        return this.newInstance(element, options);
      }
    }
459822
public EntityResult<SqlResultSetMapping<T>> getOrCreateEntityResult()
   {
      List<Node> nodeList = childNode.get("entity-result");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new EntityResultImpl<SqlResultSetMapping<T>>(this, "entity-result", childNode, nodeList.get(0));
      }
      return createEntityResult();
   }