Example usage for org.springframework.beans NotReadablePropertyException NotReadablePropertyException

List of usage examples for org.springframework.beans NotReadablePropertyException NotReadablePropertyException

Introduction

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

Prototype

public NotReadablePropertyException(Class<?> beanClass, String propertyName, String msg) 

Source Link

Document

Create a new NotReadablePropertyException.

Usage

From source file:org.jdal.ui.bind.DirectFieldAccessor.java

@Override
public Object getPropertyValue(String propertyName) throws BeansException {
    Field field = this.fieldMap.get(propertyName);
    if (field == null) {
        throw new NotReadablePropertyException(this.target.getClass(), propertyName,
                "Field '" + propertyName + "' does not exist");
    }//from w ww  . j  a  v a2 s . c  o m
    try {
        ReflectionUtils.makeAccessible(field);
        return field.get(this.target);
    } catch (IllegalAccessException ex) {
        throw new InvalidPropertyException(this.target.getClass(), propertyName, "Field is not accessible", ex);
    }
}