Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
编辑:最初是一个让我的工作更轻松的低优先级问题,现在已经成为 Java 巫术中一个非常有趣的练习。谢谢大家的意见!
我正在使用自动生成的 Java 代码(特别是 AnyLogic 生成的代码),它会生成一个名为onChange(). 我想在调用时调用我自己的方法onChange()。有没有办法onChange()通过反射或其他标准 Java 机制“挂钩”?
onChange()
我可以建议的一种解决方案是使用代理对象。这是一个教程,可能对您有所帮助。