public SmartBinder filter ( String pattern , MethodHandle filter ) { String [ ] argNames = signature ( ) . argNames ( ) ; Pattern pat = Pattern . compile ( pattern ) ; Binder newBinder = binder ( ) ; Signature newSig = signature ( ) ; for ( int i = 0 ; i < argNames . length ; i ++ ) { if ( pat . matcher ( argNames [ i ] ) . matches ( ) ) { newBinder = newBinder . filter ( i , filter ) ; newSig = newSig . argType ( i , filter . type ( ) . returnType ( ) ) ; } } return new SmartBinder ( newSig , newBinder ) ; }
Filter the arguments matching the given pattern using the given filter function .