对于多行文本Java注释工具 [英] Java annotation utility for multiline text

查看:207
本文介绍了对于多行文本Java注释工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多行Java的String 任何未来计划。

难的是如何写一个实用工具,将执行以下操作?

How difficult is it to write a utility that does the following?

@AllYouCanEatText(return="query")
private String getQuery(String empid, String[] columns) {
  String query;
  /*
  SELECT ${columns}
  FROM Employees
  WHERE empid = ${empid}
  ;
  */
  return query;
};

当然,在此之前我在枪管前跳,我应该问 - 就是这样一个工具已经可用?如果是这样,在哪里?

Of course, before I jump in front of the barrel, I should have asked - Is such a utility already available? If so, where?

目前的问题实际上是 - 我怎么在编译时读取反射的评论部分。作为与反思和注释处理熟悉的我(惨淡)水平的指标 - 我用反思过去的时间运行时间阅读方法。是编译时反射可能吗?

The issue at hand is actually - how do I read the comments section in reflection during compile time. As an indication of my (dismal) level of familiarity with Reflection and annotation processing - the last time I used reflection was run-time to read methods. Is compile-time reflection possible?

是任何人都有意与我分享一个谷歌code项目做到这一点?可能已经有一个Apache项目在进行中?

Is anyone interested in sharing a google code project with me to do this? May be there is already an apache project afoot?

推荐答案

我碰到这个来了,而以前,从来没有使用过自己,但我认为它的您正在寻找的 http://www.adrianwalker.org/2011/12/java-multiline-string.html

I came across this a while ago, never used it myself, but I think its what you are looking for http://www.adrianwalker.org/2011/12/java-multiline-string.html

这篇关于对于多行文本Java注释工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆