Get Bean From BeanBox instance
979130
private Object getBeanFromBox(BeanBox box, boolean required, Set<Object> history) {// NOSONAR
		// NOSONAR System.out.println(" Box=> box=" + box + " history=" + history);
		BeanBoxException.assureNotNull(box, "Fail to build instance for a null beanBox");
		Object bean = null;
		if (box.isSingleton()) { // Check if singleton in cache
			bean = singletonCache.get(box);
			if (bean != null)
				return bean;
		}

		if (box.isPureValue()) // if constant?
			return box.getTarget();
		if (box.getTarget() != null) {// if target?
			if (EMPTY.class != box.getTarget())
				return getBean(box.getTarget(), box.isRequired(), history);
			if (box.getType() != null)
				return getBean(box.getType(), box.isRequired(), history);
			else
				return notfoundOrException(box.getTarget(), box.isRequired());
		}

		boolean aopFound = false;// is AOP?
		if (box.getAopRules() != null || box.getMethodAops() != null)
			aopFound = true;
		else if (this.getAopRules() != null && box.getBeanClass() != null)
			for (Object[] aops : this.getAopRules()) // global AOP
				if (BeanBoxUtils.nameMatch((String) aops[1], box.getBeanClass().getName())) {
					aopFound = true;
					break;
				}
		if (aopFound)
			bean = AopUtils.createProxyBean(box.getBeanClass(), box, this);
		else if (box.getCreateMethod() != null) // if have create method?
			try {
				Method m = box.getCreateMethod();
				if (m.getParameterTypes().length == 1) {
					bean = m.invoke(box, new Caller(this, required, history, null));
				} else if (m.getParameterTypes().length == 0)
					bean = m.invoke(box);
				else
					BeanBoxException.throwEX("Create method can only have 0 or 1 parameter");
				BeanBoxException.assureNotNull(bean, "Create method created a null object.");
			} catch (Exception e) {
				return BeanBoxException.throwEX(e);
			}
		else if (box.getConstructor() != null) { // has constructor?
			if (box.getConstructorParams() != null && box.getConstructorParams().length > 0) {
				Object[] initargs = param2RealObjects(this, history, box.getConstructorParams());
				try {
					bean = box.getConstructor().newInstance(initargs);
				} catch (Exception e) {
					return BeanBoxException.throwEX(e);
				}
			} else // 0 param constructor
				try {
					bean = box.getConstructor().newInstance();
				} catch (Exception e) {
					return BeanBoxException.throwEX(e);
				}
		} else if (box.getBeanClass() != null) { // is normal bean
			if (EMPTY.class == box.getBeanClass())
				return notfoundOrException(EMPTY.class, required);
			try {
				bean = box.getBeanClass().newInstance();
			} catch (Exception e) {
				BeanBoxException.throwEX("Failed to call 0 parameter constructor of: " + box.getBeanClass(), e);
			}
		} else
			return notfoundOrException(null, required); // return null or throw EX

		// Now Bean is ready

		// Cache bean or proxy bean right now for circular dependency use
		if (box.isSingleton()) {
			Object id = box.getSingletonId();
			if (id != null)
				singletonCache.put(box, bean);
		} // NOW BEAN IS CREATED

		if (box.getConfigMethod() != null) {// ====config method of this BeanBox
			try {
				Method m = box.getConfigMethod();
				if (m.getParameterTypes().length == 2)
					m.invoke(box, bean, new Caller(this, required, history, bean));
				else if (m.getParameterTypes().length == 1)
					m.invoke(box, bean);
				else
					BeanBoxException.throwEX("Config method can only have 1 or 2 parameters");
			} catch (Exception e) {
				return BeanBoxException.throwEX(e);
			}
		}

		if (box.getPostConstruct() != null) // PostConstructor
			ReflectionUtils.invokeMethod(box.getPostConstruct(), bean);

		if (box.getFieldInjects() != null) // Fields inject
			for (Entry<Field, BeanBox> entry : box.getFieldInjects().entrySet()) {
				Field f = entry.getKey();
				BeanBox b = entry.getValue();
				Object fieldValue = this.getBeanFromBox(b, false, history);
				if (EMPTY.class == fieldValue) {
					if (b.isRequired())
						BeanBoxException.throwEX("Not found required value for field: " + f.getName() + " in "
								+ f.getDeclaringClass().getName());
				} else {
					if (fieldValue != null && fieldValue instanceof String)
						fieldValue = this.valueTranslator.translate((String) fieldValue, b.getType());
					ReflectionUtils.setField(f, bean, fieldValue);
				}
			}

		if (box.getMethodInjects() != null) { // Methods inject
			for (Entry<Method, BeanBox[]> methods : box.getMethodInjects().entrySet()) {
				Method m = methods.getKey();
				BeanBox[] paramBoxs = methods.getValue();
				if (paramBoxs != null && paramBoxs.length > 0) {
					Object[] methodParams = param2RealObjects(this, history, paramBoxs);
					ReflectionUtils.invokeMethod(m, bean, methodParams);
				} else // method has no parameter
					ReflectionUtils.invokeMethod(m, bean);
			}
		}
		return bean;
	}
557261
public static final Object getValue(Object bean, String property)
    {
        return doFor(bean, property, null, BeanHelper::getValue, BeanHelper::getValue, BeanHelper::getFieldValue, BeanHelper::getMethodValue);
    }
225573
public static Class<?> getPropertyClass(Class<?> beanClass, String field) {
		return INSTANCE.findPropertyClass(beanClass, field);
	}
1215900
@Override
    public P get(Bean bean) {
        try {
            return (P) getter.invokeExact(bean);
        } catch (RuntimeException | Error ex) {
            throw ex;
        } catch (Throwable ex) {
            throw new RuntimeException(ex);
        }
    }
1154719
private BeanO[] getBeanOs()
    {
        BeanO result[];
        result = new BeanO[ivBeanOs.size()];
        Iterator<BeanO> iter = ivBeanOs.values().iterator();
        int i = 0;
        while (iter.hasNext()) {
            result[i++] = iter.next();
        }
        return result;
    }
1229994
@Override
    protected T createInstance() throws Exception {
        for (final String beanName : this.delegateBeanNames) {
            try {
                final T bean;
                if (this.type == null) {
                    bean = (T) this.getBeanFactory().getBean(beanName);
                } else {
                    bean = this.getBeanFactory().getBean(beanName, this.type);
                }

                if (this.logger.isInfoEnabled()) {
                    this.logger.info("Loaded bean for name " + beanName);
                }

                return bean;
            } catch (final Exception e) {
                final String msg =
                        "Failed to load bean '"
                                + beanName
                                + "' from ApplicationContext"
                                + (this.type != null ? " expecting type: " + this.type : "")
                                + ". Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('"
                                + beanName
                                + "'): ";

                if (this.logger.isDebugEnabled()) {
                    this.logger.debug(msg, e);
                } else if (this.logger.isInfoEnabled()) {
                    this.logger.info(
                            msg + " " + e.getMessage() + " (enable debug for stack trace)");
                }
            }
        }

        throw new BeanCreationException(
                "None of the configured bean names could be loaded. BeanNames: "
                        + this.delegateBeanNames);
    }
182145
@Override public Set<R> getValueFromBean(D bean) throws IllegalBioPAXArgumentException
	{
		Object value = null;
		try
		{
			if (this.getDomain().isInstance(bean)) value = this.getMethod.invoke(bean);
		}
		catch (IllegalAccessException e)
		{
			throw new IllegalBioPAXArgumentException(
					"Could not invoke get method " + getMethod.getName() + " for " + bean, e);
		}
		catch (IllegalArgumentException e)
		{
			throw new IllegalBioPAXArgumentException(
					"Could not invoke get method " + getMethod.getName() + " for " + bean, e);
		}

		catch (InvocationTargetException e)
		{
			throw new IllegalBioPAXArgumentException(
					"Could not invoke get method " + getMethod.getName() + " for " + bean, e);
		}

		if (value == null) return Collections.emptySet();
		else if (this.isMultipleCardinality())
		{
			return (Collections.unmodifiableSet(((Set<R>) value)));
		} else
		{
			return Collections.singleton(((R) value));
		}
	}
611264
public <T> InternalEjbDescriptor<T> get(String beanName) {
        return cast(ejbByName.get(beanName));
    }
295045
@Override
    public Object getModel(Item item, Node node, String template) {
        return beanFactory;
    }
839034
public static Object createProxyBean(Class<?> clazz, BeanBox box, BeanBoxContext ctx) {
		BeanBoxException.assureNotNull(clazz, "Try to create a proxy bean, but beanClass not found.");
		Enhancer enhancer = new Enhancer();
		enhancer.setSuperclass(clazz);
		if (box.getConstructorParams() != null && box.getConstructorParams().length > 0) {
			BeanBox[] boxes = box.getConstructorParams();
			Class<?>[] argsTypes = new Class<?>[boxes.length];
			Object[] realArgsValue = new Object[boxes.length];
			for (int i = 0; i < boxes.length; i++) {
				argsTypes[i] = boxes[i].getType();
				Object realValue = ctx.getBean(boxes[i]);
				if (realValue != null && realValue instanceof String)
					realValue = ctx.getValueTranslator().translate((String) realValue, boxes[i].getType());
				realArgsValue[i] = realValue;
			}
			enhancer.setCallback(new ProxyBean(box, ctx));
			return enhancer.create(argsTypes, realArgsValue);
		} else {
			enhancer.setCallback(new ProxyBean(box, ctx));
			return enhancer.create();
		}
	}
1357555
@Override
    public final Object get() {
        Object o = buffer.pop();

        if (beanPerf != null) { // Update PMI data
            beanPerf.objectRetrieve(buffer.size(), (o != null));
        }

        return o;
    }
1087720
private Object getFieldValue(Object bean)
            throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        return PropertyUtils.getProperty(bean, field.getName());
    }
151108
private String getBeanMethodName(String fieldName, int type) {
      if (fieldName == null || fieldName == "") { return ""; }
      String methodName = "";
      if (type == 0) {
         methodName = "get";
      } else {
         methodName = "set";
      }
      methodName += fieldName.substring(0, 1).toUpperCase();
      if (fieldName.length() == 1) { return methodName; }
      methodName += fieldName.substring(1);
      //Log.d(TAG, "fieldName: " + fieldName + " beanMethod: " + methodName);
      return methodName;
   }
257912
@SuppressWarnings("unchecked")
    public static <T> T getBean(String name) {
        BeanManager bm = getBeanManager();
        Bean<?> bean = bm.getBeans(name).iterator().next();
        CreationalContext<?> ctx = bm.createCreationalContext(bean);
        return (T) bm.getReference(bean, bean.getBeanClass(), ctx);
    }
157223
@SuppressWarnings("unchecked")
    @Override
    public P get(Bean bean) {
        DirectMetaBean meta = (DirectMetaBean) bean.metaBean();
        return (P) meta.propertyGet(bean, name(), false);
    }
319188
public Contextual<?> getBean(Object beanKey)
    {
        if (passivationCapable)
        {
            return beanManager.getPassivationCapableBean((String) beanKey);
        }
        else
        {
            return (Contextual<?>) beanKey;
        }
    }
418173
protected Object getBeanPropertyValue(final String property, final Object bean) {
		if (bean == null) {
			return null;
		}

		if (".".equals(property)) {
			return bean;
		}

		try {
			Object data = PropertyUtils.getProperty(bean, property);
			return data;
		} catch (Exception e) {
			LOG.error("Failed to get bean property " + property + " on " + bean, e);
			return null;
		}
	}