开发者

How can I write a ClassLoader that does this?

I'm trying to make a URLClassLoader which behaves as follows:

  • If asked for a class whose name is in a given set of inclusions, load it as normal
  • Otherwise, return a dummy class of my choice

How should I go about this? My attempt at doin开发者_运维百科g this didn't work - see my earlier question for details.


Basically, you cannot do this. See my answer to your earlier question.


extend URLClassLoader in the method loadClass return super.loadClass(originalName) if in the set of inclusions or super.load(myDummyClass) otherwise...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜