Groovy - extension structure

I would like to expand the method String asTypefor processing LocalDateTime. I know how to override this method, but I have no idea where I have to put it in the project structure to work around the world - for all the lines in my project. Is it enough to distribute such an extension wherever there is a path to the class? I know that there is a special convention for extensions (META-INF / services), how does it work to override a method?

+4
source share
1 answer

All documentation on this topic is here . And here exactly the corresponding part can be found.

Module extension and module descriptor

Groovy, , . org.codehaus.groovy.runtime.ExtensionModule META-INF/services :

org.codehaus.groovy.runtime.ExtensionModule moduleName = moduleVersion = 1.0-test extensionClasses = support.MaxRetriesExtension staticExtensionClasses = support.StaticStringExtension 4 :

moduleName:

moduleVersion: . , , .

extensionClasses: , . , , .

staticExtensionClasses: . , , .

, , . . , .

, , , , . , , classpath, , . , , . , .

+2

All Articles