private boolean findBinding ( Injector injector , Class < ? > type ) { boolean found = false ; for ( Key < ? > key : injector . getBindings ( ) . keySet ( ) ) { if ( key . getTypeLiteral ( ) . getRawType ( ) . equals ( type ) ) { found = true ; break ; } } if ( ! found && injector . getParent ( ) != null ) { return findBinding ( injector . getParent ( ) , type ) ; } return found ; }
Finds binding for a type in the given injector and if not found recurses to its parent