在Eclipse中显示方法名称和参数值的模板 [英] Template to show method name and parameter values in Eclipse
本文介绍了在Eclipse中显示方法名称和参数值的模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
debug(methodName arg1 =+ arg1 +arg2 =+ arg2 +arg3 =+ arg3);
在方法中使用。例如:
public void setImage(long rowId,long contactId,String thinggy){
//调用模板这里生成:
debug(setImage rowId =+ rowId +contactId =+ contactId +thinggy =+ thinggy);
}
我找不到使用标准模板UI做的方法,也许存在一个插件来做这种事情?
解决方案
我做了一个小插件,添加了很好的格式化变量: / p>
http:// code。 google.com/p/eclipse-log-param/
Eclipse不提供有关参数类型的任何信息,因此没有Arrays.toString(.. 。)
Is there any way to have a template (Java -> Editor -> Templates) in Eclipse that generate something like this
debug("methodName arg1=" + arg1 + " arg2=" + arg2 + " arg3=" + arg3);
When used in a method. For instance:
public void setImage(long rowId, long contactId, String thinggy) {
// invoking the template here, produces this:
debug("setImage rowId=" + rowId + " contactId=" + contactId + " thinggy=" + thinggy);
}
I couldn't find a way to do that with the standard template UI, maybe there exists a plugin to do this kinds of things?
解决方案
I've made small plugin that adds nicely formatted variable:
http://code.google.com/p/eclipse-log-param/
Eclipse doesnt provide any information about parameter type, so there is no Arrays.toString(...)
这篇关于在Eclipse中显示方法名称和参数值的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文