Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: mikew01 Newsgroups: comp.lang.java.programmer Subject: Extract String and StringBuffer Date: Thu, 24 May 2012 01:29:25 -0700 (PDT) Organization: http://groups.google.com Lines: 22 Message-ID: <34c76a08-4bdb-462b-9178-c8a24d9a5dba@googlegroups.com> NNTP-Posting-Host: 83.100.145.126 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1337848165 27068 127.0.0.1 (24 May 2012 08:29:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 24 May 2012 08:29:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.100.145.126; posting-account=XBYvYwkAAAAYnPv-33ehO-SFLZJycXU7 User-Agent: G2/1.0 X-Received-Bytes: 1778 Xref: csiph.com comp.lang.java.programmer:14767 Hi all I need to extract all of the SQL select statements from a codebase ideally = during build time. The SQL queries are embedded in the source code in either String or StringB= uffer form, none of them are annotated with a unique annotation. I've been looking into AspectJ and maybe applying an aspect to the class Co= nnection for instance which could output the sql to whereever at some point= during execution, this does mean however that I'd need some way of executi= ng each and every method which executes a select statement in a unit test f= or instance. I've also briefly looked into AST as a possibility. If the queries were annotated I could have used an annotation processor but= alas they aren't. Has anyone done this kind of thing before or can reccommend a suitable meth= od? Thanks