throw log.getElementTypeHasToBeFieldOrMethodException();
}
Member member = null;
if ( ElementType.FIELD.equals( elementType ) ) {
GetDeclaredField action = GetDeclaredField.action( clazz, property );
if ( System.getSecurityManager() != null ) {
member = AccessController.doPrivileged( action );
}
else {
member = action.run();
}
}
else {
String methodName = property.substring( 0, 1 ).toUpperCase() + property.substring( 1 );
for ( String prefix : ReflectionHelper.PROPERTY_ACCESSOR_PREFIXES ) {
GetMethod action = GetMethod.action( clazz, prefix + methodName );
if ( System.getSecurityManager() != null ) {
member = AccessController.doPrivileged( action );
}
else {
member = action.run();
}
if ( member != null ) {
break;
}
}