开发者

Calling static functions that don't exist

I'd like to have 开发者_运维问答a class that will resolve calls to static functions that don't exist.

If you have an object that subclasses the Proxy class, you can override the callProperty() method to catch calls to functions, as properties of that object, that don't exist.

How can this be done with static function calls in a class? It cannot be done by making the overridden callProperty() method static. Is there another way?


I may be wrong, but I don't think there is any way to do what you are asking. Static functions have to exist and be called static so the compiler knows that they are there. I can't see any way around that. Is there any way to do what you want without it being static? Maybe if you described more about what you are trying to achieve I might be able to be more of a help.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜