@ -12,35 +12,24 @@ public class ReflectionPropertyReaderExecutor implements PropertyReaderExecutor
@@ -12,35 +12,24 @@ public class ReflectionPropertyReaderExecutor implements PropertyReaderExecutor
thrownewAccessException("Unable to access field: "+propertyName,e);
}catch(IllegalAccessExceptione){
thrownewAccessException("Unable to access field: "+propertyName,e);
}
}
if(methodToAccessProperty!=null){
try{
if(!methodToAccessProperty.isAccessible())
if(!methodToAccessProperty.isAccessible()){
methodToAccessProperty.setAccessible(true);
}
returnmethodToAccessProperty.invoke(target);
}catch(IllegalArgumentExceptione){
thrownewAccessException("Unable to access property '"+propertyName+"' through getter",e);
@ -50,6 +39,18 @@ public class ReflectionPropertyReaderExecutor implements PropertyReaderExecutor
@@ -50,6 +39,18 @@ public class ReflectionPropertyReaderExecutor implements PropertyReaderExecutor
thrownewAccessException("Unable to access property '"+propertyName+"' through getter",e);
}
}
if(fieldToAccessProperty!=null){
try{
if(!fieldToAccessProperty.isAccessible()){
fieldToAccessProperty.setAccessible(true);
}
returnfieldToAccessProperty.get(target);
}catch(IllegalArgumentExceptione){
thrownewAccessException("Unable to access field: "+propertyName,e);
}catch(IllegalAccessExceptione){
thrownewAccessException("Unable to access field: "+propertyName,e);
}
}
thrownewAccessException("No method or field accessor found for property '"+propertyName+"'");
@ -63,14 +63,14 @@ public class ReflectionPropertyResolver extends CacheablePropertyAccessor {
@@ -63,14 +63,14 @@ public class ReflectionPropertyResolver extends CacheablePropertyAccessor {
@ -93,14 +93,14 @@ public class ReflectionPropertyResolver extends CacheablePropertyAccessor {
@@ -93,14 +93,14 @@ public class ReflectionPropertyResolver extends CacheablePropertyAccessor {
// A property not found exception will occur if the reflection finder was supposed to find it
@ -12,33 +12,20 @@ public class ReflectionPropertyWriterExecutor implements PropertyWriterExecutor
@@ -12,33 +12,20 @@ public class ReflectionPropertyWriterExecutor implements PropertyWriterExecutor
thrownewAccessException("Unable to access field: "+propertyName,e);
}catch(IllegalAccessExceptione){
thrownewAccessException("Unable to access field: "+propertyName,e);
}
}
if(methodToAccessProperty!=null){
try{
if(!methodToAccessProperty.isAccessible())
@ -53,6 +40,19 @@ public class ReflectionPropertyWriterExecutor implements PropertyWriterExecutor
@@ -53,6 +40,19 @@ public class ReflectionPropertyWriterExecutor implements PropertyWriterExecutor
thrownewAccessException("Unable to access property '"+propertyName+"' through setter",e);
}
}
if(fieldToAccessProperty!=null){
try{
if(!fieldToAccessProperty.isAccessible()){
fieldToAccessProperty.setAccessible(true);
}
fieldToAccessProperty.set(target,newValue);
return;
}catch(IllegalArgumentExceptione){
thrownewAccessException("Unable to access field: "+propertyName,e);
}catch(IllegalAccessExceptione){
thrownewAccessException("Unable to access field: "+propertyName,e);
}
}
thrownewAccessException("No method or field accessor found for property '"+propertyName+"'");