protected Object getProperty ( Object callee , String property ) { // Initialize this meta bean if it has not already been initialized. if ( ! initialized ) { initialize ( callee ) ; } // Check if a getter method exists for the property being fetched. Method getterMethod = getters . get ( property ) ; if ( getterMethod == null ) { throw new IllegalArgumentException ( "No getter method for the property " + property + " exists." ) ; } // Fetch the value by calling the getter method. Object result ; try { result = getterMethod . invoke ( callee ) ; } // This should never happen as the initiliazation method should already have checked this. catch ( InvocationTargetException e ) { throw new IllegalStateException ( "The getter method for the property " + property + " threw an invocation target exception." , e ) ; } // This should never happen as the initiliazation method should already have checked this. catch ( IllegalAccessException e ) { throw new IllegalStateException ( "The getter method for the property " + property + " cannot be accessed." , e ) ; } return result ; }
Returns a single named property of the bean .