Java源码示例:org.springframework.beans.NotReadablePropertyException
示例1
@Override
@Nullable
public Object getValue(String paramName) throws IllegalArgumentException {
try {
return this.beanWrapper.getPropertyValue(paramName);
}
catch (NotReadablePropertyException ex) {
throw new IllegalArgumentException(ex.getMessage());
}
}
示例2
@Override
@Nullable
public Object getValue(String paramName) throws IllegalArgumentException {
try {
return this.beanWrapper.getPropertyValue(paramName);
}
catch (NotReadablePropertyException ex) {
throw new IllegalArgumentException(ex.getMessage());
}
}
示例3
@Override
public Object getValue(String paramName) throws IllegalArgumentException {
try {
return this.beanWrapper.getPropertyValue(paramName);
}
catch (NotReadablePropertyException ex) {
throw new IllegalArgumentException(ex.getMessage());
}
}
示例4
@Override
public Object getValue(String paramName) throws IllegalArgumentException {
try {
return this.beanWrapper.getPropertyValue(paramName);
}
catch (NotReadablePropertyException ex) {
throw new IllegalArgumentException(ex.getMessage());
}
}
示例5
@Override
public Object getValue(String paramName) throws IllegalArgumentException {
try {
return this.beanWrapper.getPropertyValue(paramName);
}
catch (NotReadablePropertyException ex) {
throw new IllegalArgumentException(ex.getMessage());
}
}
示例6
/**
* Checks whether the given property is secure.
*
* @param wrappedClass class the property is associated with
* @param propertyPath path to the property
* @return boolean true if the property is secure, false if not
*/
protected boolean isSecure(Class<?> wrappedClass, String propertyPath) {
if (KRADUtils.isSecure(propertyPath, wrappedClass)) {
return true;
}
// since this is part of a set, we want to make sure nested paths grow
setAutoGrowNestedPaths(true);
BeanWrapperImpl beanWrapper;
try {
beanWrapper = getBeanWrapperForPropertyPath(propertyPath);
} catch (NotReadablePropertyException | NullValueInNestedPathException e) {
LOG.debug("Bean wrapper was not found for " + propertyPath
+ ", but since it cannot be accessed it will not be set as secure.", e);
return false;
}
if (org.apache.commons.lang.StringUtils.isNotBlank(beanWrapper.getNestedPath())) {
PropertyTokenHolder tokens = getPropertyNameTokens(propertyPath);
String nestedPropertyPath = org.apache.commons.lang.StringUtils.removeStart(tokens.canonicalName,
beanWrapper.getNestedPath());
return isSecure(beanWrapper.getWrappedClass(), nestedPropertyPath);
}
return false;
}
示例7
@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");
}
try {
ReflectionUtils.makeAccessible(field);
return field.get(this.target);
}
catch (IllegalAccessException ex) {
throw new InvalidPropertyException(this.target.getClass(), propertyName, "Field is not accessible", ex);
}
}