public static boolean respondsTo ( Object object , String methodName ) { MetaClass metaClass = DefaultGroovyMethods . getMetaClass ( object ) ; if ( ! metaClass . respondsTo ( object , methodName ) . isEmpty ( ) ) { return true ; } Map properties = DefaultGroovyMethods . getProperties ( object ) ; return properties . containsKey ( methodName ) ; }
Return true only if the specified object responds to the named method