groovy读取类的函数签名的脚本

groovy读取类的函数签名的脚本,第1张

概述groovy读取类的函数签名的脚本

下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。

内存溢出小编现在分享给大家,也给大家做个参考。

if (args) {       def classname = args[0]       def theClass = Class.forname(classname)       def themetaClass = theClass.MetaClass       def printClass = { property ->           println "The $property of $classname:"          if (theClass.class.MetaClass.hasProperty(theClass,property))               theClass."$property".each { println it }           else if (themetaClass.MetaClass.hasProperty(themetaClass,property))               themetaClass."$property".each { println it }       }       if (args.size() == 1)           args = ['methods','MetaMethods','constructors']       else          args = args[1..-1]       args.eachWithIndex { arg,index ->           if (index > 0)               println()           printClass(arg)       }   } else {       println 'Print out the informations of the specifIEd class.'      println 'Usage: PrintClass class-full-name [methods] [MetaMethods] [constructors]'  }  

以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

总结

以上是内存溢出为你收集整理的groovy读取类的函数签名的脚本全部内容,希望文章能够帮你解决groovy读取类的函数签名的脚本所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1271496.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-08
下一篇2022-06-08

发表评论

登录后才能评论

评论列表(0条)

    保存