private static < V , F > Boolean hasCompatibleVisitMethod ( V visitor , F fluent ) { for ( Method method : visitor . getClass ( ) . getMethods ( ) ) { if ( ! method . getName ( ) . equals ( VISIT ) || method . getParameterTypes ( ) . length != 1 ) { continue ; } Class visitorType = method . getParameterTypes ( ) [ 0 ] ; if ( visitorType . isAssignableFrom ( fluent . getClass ( ) ) ) { return true ; } else { return false ; } } return false ; }
Checks if the specified visitor has a visit method compatible with the specified fluent .