Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1719 MetaClass enhancements
  3. GROOVY-1721

Discovery mechanism for customizing metaclasses with a script using ExpandoMetaClass

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • groovy-runtime
    • 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

          Activity

            People

              blackdrag Jochen Theodorou
              guillaume Guillaume Sauthier
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: