Through java.lang.reflect? I'd guess not as that would involve actually changing the bytecode of a loaded class at runtime to add methods... It's just not a JVM thing, I think - if it was, at least by any official means, Groovy would probably have been written to use it instead of all the stuff it does with metaclasses.
But if you're all in groovy, you can add methods dynamically using expando i think and then they're findable through *Groovy's* metaclass apis... but no, they won't be findable/reflectable by Java code. -- Rachel Greenham rac...@merus.eu > On 26 Aug 2021, at 14:35, o...@ocs.cz wrote: > > Hi there, > > the subject says it all. I've asked this long time ago (and got a negative > answer then), but meantime there's Groovy 3. > > Is there now a way to do that? > > Most important it would be with my own class (subclass of a library class), > if it helps to find a solution. > > Thanks, > OC >