6

WRT Any Future Plans for Multiline 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?

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

Community
  • 1
  • 1
Blessed Geek
  • 21,058
  • 23
  • 106
  • 176

1 Answers1

3

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

Riz
  • 1,055
  • 11
  • 18