Spring Framework BeanDefinitionHolder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework BeanDefinitionHolder class.

This code example shows how to use the following methods:getBeanDefinition, getBeanName
		this.definitionWrapper = new BeanWrapperImpl(bd);
		return bd;
	} 
 
	public void setBeanDefinitionHolder(BeanDefinitionHolder holder) {
		this.definition = (AbstractBeanDefinition) holder.getBeanDefinition();
		this.beanName = holder.getBeanName();
	} 
 
	public BeanDefinitionHolder getBeanDefinitionHolder() {
		return new BeanDefinitionHolder(getBeanDefinition(), getBeanName());
	} 
 
	public void setParent(Object obj) {
		if (obj == null) {
			throw new IllegalArgumentException("Parent bean cannot be set to a null runtime bean reference!");
		} 
		if (obj instanceof String) {
			this.parentName = (String) obj;
		} 
6
CodeRank
This code example shows how to use the following methods:getBeanDefinition
	 * <p>To be considered a candidate the bean's <em>autowire-candidate</em> 
	 * attribute must not have been set to 'false'. 
	 */ 
	@Override 
	public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) {
		return bdHolder.getBeanDefinition().isAutowireCandidate();
	} 
 
	@Override 
	public Object getSuggestedValue(DependencyDescriptor descriptor) {
		return null; 
	} 
 
	@Override 
	public Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, String beanName) {
		return null; 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:
 
        if (isEmptyArray(definition.getAliases())) {
            String[] defaultAliases = getDefaultAliases(definition.getBeanName());
 
            if (!isEmptyArray(defaultAliases)) {
                newHolder = new BeanDefinitionHolder(definition.getBeanDefinition(), definition.getBeanName(),
                                                     defaultAliases);
            } 
        } 
 
        parser.super_registerBeanDefinition(newHolder, registry);
    } 
 
    private String getDefaultId() {
        String[] names = getDefaultNames();
 
        if (names.length > 0) {
            return names[0];
        } 
 
6
CodeRank
This code example shows how to use the following methods:getBeanDefinition
		return beanDefinition;
	} 
 
	@Override 
	protected void registerBeanDefinition(BeanDefinitionHolder definition, BeanDefinitionRegistry registry) {
		String scope = definition.getBeanDefinition().getScope();
		if (!AbstractBeanDefinition.SCOPE_DEFAULT.equals(scope) && !AbstractBeanDefinition.SCOPE_SINGLETON.equals(scope) && !AbstractBeanDefinition.SCOPE_PROTOTYPE.equals(scope)) {
			definition = ScopedProxyUtils.createScopedProxy(definition, registry, false);
		} 
		super.registerBeanDefinition(definition, registry);
	} 
 
	/** 
	 * Subclasses must implement this method to create the bean definition. 
	 * The class must be defined, and any implementation-specific constructor 
	 * arguments or properties should be configured. This base class will 
	 * configure the interceptors including the 'datatype' interceptor if 
	 * the 'datatype' attribute is defined on the channel element. 
	 * 
	 * @param element The element. 
5
CodeRank
This code example shows how to use the following methods:getBeanDefinition
	private static class ObjectNameBeanDefinitionDecorator implements BeanDefinitionDecorator { 
 
		@Override 
		public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) { 
			Attr objectNameAttribute = (Attr) node; 
			definition.getBeanDefinition().setAttribute("objectName", objectNameAttribute.getValue()); 
			return definition; 
		} 
	} 
} 
 
5
CodeRank
This code example shows how to use the following methods:
  } 
 
  private BeanDefinitionHolder createBeanDefinitionHolder(
      BeanDefinition beanDefinition) {
    String beanName = CACHING_LISTENER_BEAN_NAME;
    BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDefinition,
        beanName);
    return holder;
  } 
 
  private BeanDefinition createCachingListenerBeanDefinition() {
    return new RootBeanDefinition(CachingListener.class);
  } 
 
} 
4
CodeRank
This code example shows how to use the following methods:getBeanDefinition
	 * fallback to match against the bean name or an alias if a qualifier or 
	 * attribute does not match. 
	 * @see Qualifier 
	 */ 
	public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) {
		if (!bdHolder.getBeanDefinition().isAutowireCandidate()) {
			// if explicitly false, do not proceed with qualifier check 
			return false; 
		} 
		if (descriptor == null) {
			// no qualification necessary 
			return true; 
		} 
		boolean match = checkQualifiers(bdHolder, descriptor.getAnnotations());
		if (match) {
			MethodParameter methodParam = descriptor.getMethodParameter();
			if (methodParam != null) {
				Method method = methodParam.getMethod();
				if (method == null || void.class.equals(method.getReturnType())) {
					match = checkQualifiers(bdHolder, methodParam.getMethodAnnotations());
4
CodeRank
This code example shows how to use the following methods:getBeanDefinition, getBeanName
This code example shows how to use the following methods:
This code example shows how to use the following methods:getBeanDefinition
 
    @Override 
    protected void registerBeanDefinition(BeanDefinitionHolder definitionHolder, BeanDefinitionRegistry registry) {
        try { 
            @SuppressWarnings({"unchecked"}) 
            Class<? extends Page> clazz = (Class<? extends Page>) Class.forName(definitionHolder.getBeanDefinition().getBeanClassName());
            if (clazz.isAnnotationPresent(ModulePage.class)) {
                moduleConfiguration.addPageConfiguration(new PageConfiguration(clazz));
            } 
            else if (clazz.isAnnotationPresent(NavigationBox.class)) {
                moduleConfiguration.addBox(new BoxConfiguration(clazz));
            } 
            else if (clazz.isAnnotationPresent(GenericRepository.class)) {
                BeanDefinitionHolder beanDefinitionHolder = buildGenericRepositoryDefinition(clazz);
                super.registerBeanDefinition(beanDefinitionHolder, registry);
            } 
            else if (clazz.isAnnotationPresent(Entity.class)
                    || clazz.isAnnotationPresent(org.hibernate.annotations.Entity.class)) {
                moduleConfiguration.addEntity(clazz);
                if (clazz.isAnnotationPresent(RegisterGenericDataProvider.class)) {
4
CodeRank
See Code Examples for Spring Framework BeanDefinitionHolder Methods: