Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1033863 // proxy_printAllMethodCalls

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4608L/26K).

1  
static <A> A nuLike proxy_printAllMethodCalls(Class<A> intrface, S prefix default "") {
2  
  ret (A) java.lang.reflect.Proxy.newProxyInstance(intrface.getClassLoader(),
3  
   new Class[] { intrface },
4  
   new InvocationHandler {
5  
     public O invoke(O proxy, Method method, O[] args) {
6  
       print(prefix, renderFunctionCall(method.getName(), args));
7  
       null;
8  
     }
9  
   });
10  
}

Author comment

Began life as a copy of #1029148

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033863
Snippet name: proxy_printAllMethodCalls
Eternal ID of this version: #1033863/3
Text MD5: 700901c774fd830a5c599c06a3b93051
Transpilation MD5: 592224ffe51067f8d5cae741cec56eaa
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-07 20:33:49
Source code size: 382 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 146 / 225
Version history: 2 change(s)
Referenced in: [show references]