Many annotations are referentially @Opaque

Often Java elements (such as classes or methods) have meaning beyond their "denotational semantics": the name (or, occasionally, just presence) of the element itself is significant to how the application runs, beyond simple references from other Java source code. For example, a field marked with @javax.persistence.Column cannot be freely renamed or shuffled around according to traditional refactoring tools.

It would be great if there were a consistent way to mark these kinds of annotations. Authors of Java frameworks could then indicate to tools that Java elements marked with them need to be treated conservatively.

My suggestion is to introduce a meta-annotation (i.e. annotation placed on other annotations): @Opaque. Here is source code for the annotation and some possible example usages.

Comments:

Nice and handy idea, I am just wondering what if the meta-annotation would need to be meta-annotated? Will it be possible? Or would be there a need for some meta-meta-annotation?

Posted by ak on September 24, 2008 at 10:40 PM EDT #

Well you can always annotate any annotation, though I am not sure why you would need to do so in this case.

Posted by Jesse Glick on September 25, 2008 at 04:44 AM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

jglick

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today