Is it possible to implement an interface at runtime in Java?

前端 未结 4 1363
梦谈多话
梦谈多话 2021-02-01 20:29

I am working on a project where there are a lot of objects that are created by a library, and I have no access to the creation process of these objects.

The following sn

4条回答
  •  迷失自我
    2021-02-01 20:55

    I don't think what you want is possible; there are Dynamic Proxies, but they use reflection, and it doesn't look likely that you have access to the classloader (where you could set your own that did on-the-fly bytecode manipulation).

提交回复
热议问题