Spring Framework BeanDefinition - 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 BeanDefinition class.

This code example shows how to use the following methods:setBeanClass, setBeanClassName, setLazyInit, setScope, validate
	@Override 
	protected final AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
		BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition();
		String parentName = getParentName(element);
		if (parentName != null) {
			builder.getRawBeanDefinition().setParentName(parentName);
		} 
		Class<?> beanClass = getBeanClass(element);
		if (beanClass != null) {
			builder.getRawBeanDefinition().setBeanClass(beanClass);
		} 
		else { 
			String beanClassName = getBeanClassName(element);
			if (beanClassName != null) {
				builder.getRawBeanDefinition().setBeanClassName(beanClassName);
			} 
		} 
		builder.getRawBeanDefinition().setSource(parserContext.extractSource(element));
		if (parserContext.isNested()) {
			// Inner bean definition must receive same scope as containing bean. 

7
CodeRank
This code example shows how to use the following methods:getResourceDescription
				"Resource cannot be opened because it points to " + getDescription()); 
	} 
 
	@Override 
	public String getDescription() {
		return "BeanDefinition defined in " + this.beanDefinition.getResourceDescription();
	} 
 
 
	/** 
	 * This implementation compares the underlying BeanDefinition. 
	 */ 
	@Override 
	public boolean equals(Object obj) {
		return (obj == this ||
			(obj instanceof BeanDefinitionResource &&
						((BeanDefinitionResource) obj).beanDefinition.equals(this.beanDefinition)));
	} 
 
	/** 
6
CodeRank
This code example shows how to use the following methods:getFactoryBeanName, getAttribute
	protected boolean shouldSkip(ConfigurableListableBeanFactory beanFactory, String beanName) {
		if (beanFactory == null || !beanFactory.containsBeanDefinition(beanName)) {
			return false; 
		} 
		BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);
		if (beanDefinition.getFactoryBeanName() != null) {
			return true; 
		} 
		Object value = beanDefinition.getAttribute(SKIP_REQUIRED_CHECK_ATTRIBUTE);
		return (value != null && (Boolean.TRUE.equals(value) || Boolean.valueOf(value.toString())));
	} 
 
	/** 
	 * Is the supplied property required to have a value (that is, to be dependency-injected)? 
	 * <p>This implementation looks for the existence of a 
	 * {@link #setRequiredAnnotationType "required" annotation} 
	 * on the supplied {@link PropertyDescriptor property}. 
	 * @param propertyDescriptor the target PropertyDescriptor (never {@code null}) 
	 * @return {@code true} if the supplied property has been marked as being required; 
	 * {@code false} if not, or if the supplied property does not have a setter method 
6
CodeRank
This code example shows how to use the following methods:getPropertyValues
This code example shows how to use the following methods:isAutowireCandidate
	 * <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:getPropertyValues
This code example shows how to use the following methods:getPropertyValues
 
	/** 
	 * Returns the source. 
	 * @return the source 
	 */ 
	public Object getSource() {
		return this.source;
	} 
 
	/** 
	 * Return a {@link CompositeComponentDefinition} for this element. 
	 * @return the composite component definition 
	 */ 
	public CompositeComponentDefinition getComponentDefinition() {
		return new CompositeComponentDefinition(this.element.getTagName(), this.source);
	} 
 
	/** 
	 * Create a new {@link RootBeanDefinition} with <tt>ROLE_INFRASTRUCTURE</tt> linked to the {@link #getSource() 
	 * source}. 

5
CodeRank
This code example shows how to use the following methods:getBeanClassName, getConstructorArgumentValues, getFactoryBeanName, getFactoryMethodName, getParentName

5
CodeRank
This code example shows how to use the following methods:getPropertyValues
This code example shows how to use the following methods:getBeanClassName, getConstructorArgumentValues, getFactoryBeanName, getFactoryMethodName, getParentName
	} 
 
	/** 
	 * Return the target definition that is being decorated by this bean definition, if any. 
	 */ 
	public BeanDefinitionHolder getDecoratedDefinition() {
		return this.decoratedDefinition;
	} 
 
	/** 
	 * Specify the target type of this bean definition, if known in advance. 
	 */ 
	public void setTargetType(Class<?> targetType) {
		this.targetType = targetType;
	} 
 
	/** 
	 * Return the target type of this bean definition, if known 
	 * (either specified in advance or resolved on first instantiation). 
	 */ 

4
CodeRank
See Code Examples for Spring Framework BeanDefinition Methods: