Gets the aspect advice bean.

@param <T> the generic type
@param aspectId the aspect id
@return the aspect advice bean
337398
@SuppressWarnings("unchecked")
    public <T> T getAspectAdviceBean(String aspectId) {
        return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAspectAdviceBean(aspectId) : null);
    }
1048929
public static <T extends Annotation> Optional<T> getAnnotation(Class<?> beanClass, Class<T> annotationClass) {
		Class<?> currentClass = beanClass;
		while (currentClass != null && currentClass != Object.class) {
			if (currentClass.isAnnotationPresent(annotationClass)) {
				return Optional.of(currentClass.getAnnotation(annotationClass));
			}
			currentClass = currentClass.getSuperclass();
		}

		return Optional.empty();
	}
835446
@Override
    @SuppressWarnings("unchecked")
    public <T> T get(Contextual<T> contextual) {
        Bean bean = (Bean) contextual;
        // you can store the bean somewhere
        if (somewhere.containsKey(bean.getName())) {
            return (T) somewhere.get(bean.getName());
        } else {
            return null;
        }
    }
771076
public static <T> T getBean(ApplicationContext appContext, String id, Class<T> clazz) {
        try {
            return appContext.getBean(id, clazz);
        } catch (BeansException e) {
            return null;
        }
    }
729069
@Override
    @SuppressFBWarnings(value = "UL_UNRELEASED_LOCK", justification = "False positive from FindBugs")
    public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
        if (!isActive()) {
            throw new ContextNotActiveException();
        }
        checkContextInitialized();
        final BeanStore beanStore = getBeanStore();
        if (beanStore == null) {
            return null;
        }
        if (contextual == null) {
            throw ContextLogger.LOG.contextualIsNull();
        }
        BeanIdentifier id = getId(contextual);
        ContextualInstance<T> beanInstance = beanStore.get(id);
        if (beanInstance != null) {
            return beanInstance.getInstance();
        } else if (creationalContext != null) {
            LockedBean lock = null;
            try {
                if (multithreaded) {
                    lock = beanStore.lock(id);
                    beanInstance = beanStore.get(id);
                    if (beanInstance != null) {
                        return beanInstance.getInstance();
                    }
                }
                T instance = contextual.create(creationalContext);
                if (instance != null) {
                    beanInstance = new SerializableContextualInstanceImpl<Contextual<T>, T>(contextual, instance, creationalContext, serviceRegistry.get(ContextualStore.class));
                    beanStore.put(id, beanInstance);
                }
                return instance;
            } finally {
                if (lock != null) {
                    lock.unlock();
                }
            }
        } else {
            return null;
        }
    }
984636
public <T> T toBeanWithCamelCase(T bean) {
		BeanUtil.fillBeanWithMap(this, bean, true, false);
		return bean;
	}
650904
public static AspectranWebService create(WebActivityServlet servlet, AspectranWebService rootService) {
        ServletContext servletContext = servlet.getServletContext();
        ServletConfig servletConfig = servlet.getServletConfig();
        String aspectranConfigParam = servletConfig.getInitParameter(ASPECTRAN_CONFIG_PARAM);
        if (aspectranConfigParam != null) {
            AspectranWebService service = create(servletContext, aspectranConfigParam);
            servletContext.setAttribute(STANDALONE_WEB_SERVICE_ATTRIBUTE_PREFIX +
                    servlet.getServletName(), service);
            return service;
        } else {
            return rootService;
        }
    }
1042647
@Override
    public Object getAttribute(String arg0) {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getAttribute(arg0);
        } finally {
            collaborator.postInvoke();
        }
    }
649166
public ControlBean getBean(String id)
    {
        // If no control id separator found, the bean is a direct child of this context
        int delim = id.indexOf(org.apache.beehive.controls.api.bean.ControlBean.IDSeparator);
        if (delim < 0)  // child is a direct descendent
            return (ControlBean)_childMap.get(id);

        // Find the child referenced by the first element in the path
        ControlBean bean = (ControlBean)_childMap.get(id.substring(0, delim));
        if (bean == null)
            return bean;

        // Get the BeanContext associated with the found child, and then ask it
        // to resolve the rest of the path
        return bean.getBeanContextProxy().getBean(id.substring(delim+1));
    }
577840
public <T> T getArgBean(Class<? extends T> beanClass) {
        return Reflection.toType(argMap, beanClass);
    }
218443
public <T> T getDocument(String indexName, String indexType,String documentId,Map<String,Object> options,Class<T> beanType) throws ElasticSearchException{
		try{
			SearchHit searchResult = this.client.executeRequest(BuildTool.buildGetDocumentRequest(  indexName,   indexType,  documentId,  options),null,   new GetDocumentResponseHandler( beanType),ClientUtil.HTTP_GET);

			return ResultUtil.buildObject(searchResult, beanType);
		}
		catch(ElasticSearchException e){
			return ResultUtil.hand404HttpRuntimeException(e,beanType,ResultUtil.OPERTYPE_getDocument);
		}

	}
404669
public <T> T getDocument(String indexName, String documentId, Class<T> beanType) throws ElasticSearchException{
		return getDocument(  indexName,   _doc,  documentId,  beanType);
	}
211180
public static <T> T getProperty(Object bean, String name, Class<T> clazz) throws Exception {
        Method method = ReflectUtils.getPropertyGetterMethod(bean.getClass(), name);
        if (method.isAccessible()) {
            return (T) method.invoke(bean);
        } else {
            try {
                method.setAccessible(true);
                return (T) method.invoke(bean);
            } finally {
                method.setAccessible(false);
            }
        }
    }
479708
public BeanId getBeanId() {
        if (ivBeanId == null) {
            ivBeanId = new BeanId(ivBMD.j2eeName, null, false);
        }
        return ivBeanId;
    }
1035256
public static AspectranWebService create(WebActivityServlet servlet) {
        ServletContext servletContext = servlet.getServletContext();
        ServletConfig servletConfig = servlet.getServletConfig();
        String aspectranConfigParam = servletConfig.getInitParameter(ASPECTRAN_CONFIG_PARAM);
        if (aspectranConfigParam == null) {
            log.warn("No specified servlet initialization parameter for instantiating AspectranWebService");
        }

        AspectranWebService service = create(servletContext, aspectranConfigParam);
        String attrName = STANDALONE_WEB_SERVICE_ATTRIBUTE_PREFIX + servlet.getServletName();
        servletContext.setAttribute(attrName, service);

        if (log.isDebugEnabled()) {
            log.debug("The AspectranWebService attribute in ServletContext has been created; " +
                    attrName + ": " + service);
        }

        return service;
    }
1002478
public function getMethodAnnotation(ReflectionMethod $method, $annotation = null)
    {
        if ($annotation === null) {
            if ($this->annotation === null) {
                throw new AspectAnnotationException(
                    sprintf('Annotation not provided for aspect: "%s"', get_class($this))
                );
            }

            $annotation = $this->annotation;
        }

        return $this->annotationReader->getMethodAnnotation(
            $method,
            $annotation
        );
    }
782310
public <T> T getBean(K key, Class<T> beanType) {
		final JSONObject obj = getJSONObject(key);
		return (null == obj) ? null : obj.toBean(beanType);
	}