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

This code example shows how to use the following methods:setAutoGrowCollectionLimit, setPropertyValue, setAutoGrowNestedPaths, setConversionService
		} 
	} 
 
	public void setValue(Object context, Object value) {
		try { 
			BeanWrapperImpl beanWrapper = new BeanWrapperImpl(context);
			beanWrapper.setAutoGrowNestedPaths(autoGrowNestedPaths);
			beanWrapper.setAutoGrowCollectionLimit(autoGrowCollectionLimit);
			beanWrapper.setConversionService(conversionService.getDelegateConversionService());
			beanWrapper.setPropertyValue(expression, value);
		} catch (NotWritablePropertyException e) {
			throw new PropertyNotFoundException(context.getClass(), expression, e);
		} catch (TypeMismatchException e) {
			throw new ValueCoercionException(context.getClass(), expression, value, e.getRequiredType(), e);
		} catch (BeansException e) {
			throw new EvaluationException(context.getClass(), getExpressionString(),
					"A BeansException occurred setting the value of expression '" + getExpressionString() 
							+ "' on context [" + context.getClass() + "] to [" + value + "]", e);
		} 
	} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue, setWrappedInstance
	private Object getPropertyValue(Object obj) {
		// If a nested property cannot be read, simply return null 
		// (similar to JSTL EL). If the property doesn't exist in the 
		// first place, let the exception through. 
		try { 
			this.beanWrapper.setWrappedInstance(obj);
			return this.beanWrapper.getPropertyValue(this.sortDefinition.getProperty());
		} 
		catch (BeansException ex) {
			logger.info("PropertyComparator could not access property - treating as null for sorting", ex);
			return null; 
		} 
	} 
 
 
	/** 
	 * Sort the given List according to the given sort definition. 
	 * <p>Note: Contained objects have to provide the given property 
	 * in the form of a bean property, i.e. a getXXX method. 
	 * @param source the input List 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyType, getPropertyValue, setPropertyValue, setAutoGrowNestedPaths
This code example shows how to use the following methods:getPropertyValue, setWrappedInstance
            return ""; 
        } 
        if (beanWrapper == null) {
            beanWrapper = new BeanWrapperImpl(value);
        } else { 
            beanWrapper.setWrappedInstance(value);
        } 
        return String.valueOf(beanWrapper.getPropertyValue(propertyName));
    } 
 
    /** 
     * @return the property name 
     */ 
    public String getPropertyName() {
        return propertyName;
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
     * {@link #checkBean(org.springframework.beans.BeanWrapper)}; 
     * 
     * @throws IllegalArgumentException when the passed in object is <code>null</code>. 
     */ 
    public final boolean doCheck(Object object) {
        return checkBean(new BeanWrapperImpl(object));
    } 
 
    protected abstract boolean checkBean(BeanWrapper beanWrapper);
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isReadableProperty
public class IntrospectionJavaTests { 
 
	@Test
	public void testSomething() { 
		Object ctx = new GrailsWebApplicationContext();
		BeanWrapperImpl wrapper = new BeanWrapperImpl(ctx);
		assert wrapper.isReadableProperty("autowireCapableBeanFactory");
	} 
 
	void getMessageSource() { 
		//return null; 
	} 
} 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyType
            } 
        } 
    } 
 
    private Class extractPropertyClass(Object target, String property) {
        BeanWrapperImpl wrapper = new BeanWrapperImpl(target);
        return wrapper.getPropertyType(property);
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
            return null; 
        } 
        else { 
            String result = null;
            try { 
                BeanWrapperImpl wrapper = new BeanWrapperImpl(this.getValue());
                result = wrapper.getPropertyValue(this.propertyName).toString();
            } 
            catch(Exception ex) {
                throw new ReflectivePropertyEditorException("An error occurred while getting: " + this.propertyName, ex);
            } 
            return result;
        } 
    } 
     
    public void setAsText(String textValue) {
        try { 
            if (this.stringConvertor == null) {
                Method method =  this.dataAccessObject.getClass().getMethod(this.dataAccessMethod, new Class[]{String.class});
                this.setValue(method.invoke(this.dataAccessObject, new Object[]{textValue}));
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPropertyValue
            } 
        } 
        // Convert from object to string: 
        else { 
            try { 
                BeanWrapperImpl wrapper = new BeanWrapperImpl(element);
                result = wrapper.getPropertyValue(this.propertyName).toString();
            } catch(Exception ex) {
                throw new ReflectiveCollectionEditorException("An error occurred while getting: " + this.propertyName, ex);
            } 
        } 
         
        return result;
    } 
     
    public String getPropertyName() {
        return this.propertyName;
    } 
     
    public void setPropertyName(String propertyName) {
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
	/** Default suffix for building a config location for a namespace */ 
	public static final String DEFAULT_CONFIG_LOCATION_SUFFIX = ".groovy"; 
 
 
	private final BeanWrapper contextWrapper = new BeanWrapperImpl(this); 
 
	private MetaClass metaClass = GroovySystem.getMetaClassRegistry().getMetaClass(getClass()); 
 
 
	/** 
	 * Loads the bean definitions via an GroovyBeanDefinitionReader. 
	 * @see org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader 
	 * @see #initBeanDefinitionReader 
	 * @see #loadBeanDefinitions 
	 */ 
	@Override 
	protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws BeansException, IOException { 
		// Create a new XmlBeanDefinitionReader for the given BeanFactory. 
		GroovyBeanDefinitionReader beanDefinitionReader = new GroovyBeanDefinitionReader(beanFactory); 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework BeanWrapperImpl Methods: