Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 3.0
-
Component/s: None
-
Labels:None
-
Number of attachments :
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.
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
-
This should go to 2.0 or at least 1.2