Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Currently, it is possible to define custom MetaClasses at load time by following the convention:
groovy.runtime.metaclass.java.lang.StringMetaClass
Creating this StringMetaClass in this specific place will use this metaclass in lieu of the default metaclass.
By adding ExpandoMetaClass back in Groovy, we should provide a mechanism for customizing metaclasses.
For instance, we could create an expandoMetaClassScript.groovy in the package groovy.runtim.metaclass.
And in this script, we would use ExpandoMetaClasses to customize classes behaviour further.
Attachments
Issue Links
- relates to
-
GROOVY-3944 Add a META-INF/services mechanism (similar to global ast transformations) that allows custom ExpandoMetaClass code to be run when a class is loaded
- Open