`
boogie
  • 浏览: 237383 次
  • 性别: Icon_minigender_1
  • 来自: 宁波
社区版块
存档分类
最新评论

Calling static methods on metaclass

阅读更多

1、MyClass with a static method

class MyClass
{
                static processList(list)
                {
                                // does something
                }
}

 

2、Calling static method processList

doProcessList(String className, list)
{
     MetaClass mc =   GroovySystem.metaClassRegistry.getMetaClass(Class.forName(className))
                mc.invokeStaticMethod(‘processList’, list)
}
 
分享到:
评论

相关推荐

    servlet2.4doc

    A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both. Filters perform filtering in the ...

    Professional.MFC.with.VC6

    Alternative Calling Conventions Using and Writing DLLs with MFC MFC DLL Models Summary of DLL Models About DLLApp Troubleshooting DLL Projects Debugging DLL Projects Debug Information DLL ...

    ZendFramework中文文档

    4.3.4. Zend_Cache_Frontend_Class 4.3.4.1. Introduction 4.3.4.2. Available options 4.3.4.3. Examples 4.3.5. Zend_Cache_Frontend_File 4.3.5.1. Introduction 4.3.5.2. Available options 4.3.5.3. ...

    spring-framework-reference4.1.4

    3.2. Removed Deprecated Packages and Methods .................................................... 17 3.3. Java 8 (as well as 6 and 7) .....................................................................

    spring-framework-reference-4.1.2

    3.2. Removed Deprecated Packages and Methods .................................................... 17 3.3. Java 8 (as well as 6 and 7) .....................................................................

Global site tag (gtag.js) - Google Analytics