@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public static Object getPropertyValueOfNewInstance ( Class clazz , String propertyName , Class < ? > propertyType ) { // validate if ( clazz == null || ! StringUtils . hasText ( propertyName ) ) { return null ; } try { return getPropertyOrStaticPropertyOrFieldValue ( BeanUtils . instantiateClass ( clazz ) , propertyName ) ; } catch ( BeanInstantiationException e ) { return null ; } }
Returns the value of the specified property and type from an instance of the specified Grails class