public static < T > T getField ( Class < T > returnType , Class < ? > targetClass , Object target , String field ) { try { Field declaredField = targetClass . getDeclaredField ( field ) ; return AccessController . doPrivileged ( new GetFieldPrivilegedAction < T > ( declaredField , target ) ) ; } catch ( NoSuchFieldException e ) { throw new TransfuseInjectionException ( "NoSuchFieldException Exception during field injection: " + field + " in " + target . getClass ( ) , e ) ; } catch ( PrivilegedActionException e ) { throw new TransfuseInjectionException ( "PrivilegedActionException Exception during field injection" , e ) ; } catch ( Exception e ) { throw new TransfuseInjectionException ( "Exception during field injection" , e ) ; } }
Returns the value of a field .