If not already created, a new <code>bean</code> element will be created and returned.
Otherwise, the first existing <code>bean</code> element will be returned.
@return the instance defined for the element <code>bean</code>
5018
public BeanType<ConstraintMappingsType<T>> getOrCreateBean()
   {
      List<Node> nodeList = childNode.get("bean");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new BeanTypeImpl<ConstraintMappingsType<T>>(this, "bean", childNode, nodeList.get(0));
      }
      return createBean();
   }
990577
@Override
    @SuppressWarnings("unchecked")
    public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
        Bean bean = (Bean) contextual;
        // you can store the bean somewhere
        if (somewhere.containsKey(bean.getName())) {
            return (T) somewhere.get(bean.getName());
        } else {
            T t = (T) bean.create(creationalContext);
            somewhere.put(bean.getName(), t);
            return t;
        }
    }
526298
public LinkedHashMap<String, CmsContainerElementBean> getNewElementsInOrder() {

        LinkedHashMap<String, CmsContainerElementBean> result = new LinkedHashMap<String, CmsContainerElementBean>();
        if (m_ordering != null) {
            for (String orderKey : m_ordering) {
                CmsContainerElementBean element = m_newElements.get(orderKey);
                if (element != null) {
                    result.put(orderKey, element);
                }
            }
            return result;
        }
        return new LinkedHashMap<String, CmsContainerElementBean>();
    }
1106825
public static <T> T cloneBean(final Object bean) {
		try {
			return (T) BeanUtils.cloneBean(bean);
		} catch (IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException e) {
			throw new RuntimeException(e);
		}
	}
307333
public String getTypeBeanErased() {
        if (isBeanGenericType()) {
            for (int i = 0; i < bean.getTypeGenericCount(); i++) {
                if (type.equals(bean.getTypeGenericName(i, false))) {
                    return bean.getTypeGenericErased(i);
                }
            }
        }
        String generic = getTypeGenericsSimple();
        if (generic.isEmpty()) {
            return type;
        }
        StringTokenizer tkn = new StringTokenizer(generic, ",");
        List<String> altered = new ArrayList<>();
        while (tkn.hasMoreTokens()) {
            String genericType = tkn.nextToken().trim();
            String erased = genericType;
            if (bean.isTypeGenerifiedBy(genericType)) {
                for (int i = 0; i < bean.getTypeGenericCount(); i++) {
                    if (genericType.equals(bean.getTypeGenericName(i, false))) {
                        erased = bean.getTypeGenericErased(i);
                    }
                }
            }
            altered.add(erased);
        }
        return getTypeRaw() + "<" + altered.stream().collect(joining(", ")) + ">";
    }
1014394
public Scan<BeansDescriptor> getOrCreateScan()
   {
      List<Node> nodeList = model.get("scan");
      if (nodeList != null && nodeList.size() > 0)
      {
         return new ScanImpl<BeansDescriptor>(this, "scan", model, nodeList.get(0));
      }
      return createScan();
   }
669778
public static <T> CheckResult<T> checkBean(Object bean) {
        return checkBean(bean, new HashMap<>(ValueConsts.TWO_INT));
    }
149194
public Object previous() {
        Object element = null;
        if (previousElement != null) {
            element = previousElement;
            previousElement = null;
        } else {
            element = getPreviousElement();
            if (element == null) {
                throw new java.util.NoSuchElementException();
            }
        }
        return element;
    }
156461
public ColumnResult<ConstructorResult<T>> getOrCreateColumn()
   {
      List<Node> nodeList = childNode.get("column");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ColumnResultImpl<ConstructorResult<T>>(this, "column", childNode, nodeList.get(0));
      }
      return createColumn();
   }
1018783
public Object nextElement()
    {
        try
        {
            if (!hasCalledCheck)
            {    
                hasMoreElements();
            }    
            hasCalledCheck = false;
            if (hasNext)
            {
                Identity oid = getIdentityFromResultSet();
                Identity[] args = {oid};
                return this.constructor.newInstance(args);
            }
            else
                throw new NoSuchElementException();
        }
        catch (Exception ex)
        {
            LoggerFactory.getDefaultLogger().error(ex);
            throw new NoSuchElementException();
        }
    }
801608
public FacesConfigManagedBeanType<WebFacesConfigDescriptor> getOrCreateManagedBean()
   {
      List<Node> nodeList = model.get("managed-bean");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigManagedBeanTypeImpl<WebFacesConfigDescriptor>(this, "managed-bean", model, nodeList.get(0));
      }
      return createManagedBean();
   }
1335647
public Object getNextElement() {
        Object element = null;
        while (currentIndex+1 < endIndex && element == null) {
            currentIndex++;
            element = getElement();
        }
        return element;      
    }
1336856
@Bean(name = "resourcesElementsProvider")
    public ResourcesElementsProvider getResourcesElementsProvider() {
        ResourcesElementsProviderImpl rslt = new ResourcesElementsProviderImpl();
        rslt.setResourcesDao(getResourcesDao());
        return rslt;
    }
504827
protected T instantiateBean(final Class<T> clazz) {
        
        final T bean;
        if( clazz.isInterface() ) {
            bean = BeanInterfaceProxy.createProxy(clazz);
        } else {
            try {
                bean = clazz.newInstance();
            } catch(InstantiationException e) {
                throw new SuperCsvReflectionException(String.format(
                    "error instantiating bean, check that %s has a default no-args constructor", clazz.getName()), e);
            } catch(IllegalAccessException e) {
                throw new SuperCsvReflectionException("error instantiating bean", e);
            }
        }
        
        return bean;
        
    }
1361350
public static <Request> Input create(Request requestBean) {
        if (requestBean == null)
            throw new IllegalArgumentException("request bean should not be null!");
        Class requestClass = requestBean.getClass();
        return create(requestClass);
    }
278137
public FacesConfigAttributeType<FacesConfigConverterType<T>> getOrCreateAttribute()
   {
      List<Node> nodeList = childNode.get("attribute");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigAttributeTypeImpl<FacesConfigConverterType<T>>(this, "attribute", childNode, nodeList.get(0));
      }
      return createAttribute();
   }
827627
@Override
    protected Map createInstance() {
        if (applicationContext.containsBean(UrlMappingFactoryBean.URL_MAP_BEAN)) {
            Object o = applicationContext.getBean(UrlMappingFactoryBean.URL_MAP_BEAN);
            if (o instanceof Map) {
                mappings.putAll((Map)o);
            }
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug("[UrlMappingFactoryBean] Creating URL mappings as...");
            for (Object key : mappings.keySet()) {
                LOG.debug("[UrlMappingFactoryBean] " + key + "=" + mappings.get(key));
            }
        }
        return mappings;
    }