Example usage for org.springframework.beans ConfigurablePropertyAccessor getPropertyValue

List of usage examples for org.springframework.beans ConfigurablePropertyAccessor getPropertyValue

Introduction

In this page you can find the example usage for org.springframework.beans ConfigurablePropertyAccessor getPropertyValue.

Prototype

@Nullable
Object getPropertyValue(String propertyName) throws BeansException;

Source Link

Document

Get the current value of the specified property.

Usage

From source file:com.javaetmoi.core.mvc.tag.Html5InputTag.java

protected Object getBean(String beanName, Map<String, Object> model) {
    Object bean;/*  w  w w  .j  a  v  a 2 s.  com*/
    if (model != null) {
        bean = model.get(beanName);
    } else {
        ConfigurablePropertyAccessor bw = PropertyAccessorFactory.forDirectFieldAccess(getRequestContext());
        HttpServletRequest request = (HttpServletRequest) bw.getPropertyValue("request");
        bean = request.getAttribute(beanName);
    }
    return bean;
}

From source file:org.codehaus.groovy.grails.web.binding.GrailsDataBinder.java

private boolean isNullAndWritableProperty(ConfigurablePropertyAccessor accessor, String propertyName) {
    return accessor.isWritableProperty(propertyName)
            && (accessor.isReadableProperty(propertyName) && accessor.getPropertyValue(propertyName) == null);
}