@Java']Java: Bringing a richer annotation model to Java']Java

被引:15
作者
Cazzola, Walter [1 ]
Vacchi, Edoardo [1 ]
机构
[1] Univ Milan, Dept Comp Sci, I-20122 Milan, Italy
关键词
!text type='Java']Java[!/text; Meta-data; Annotations; Reflection; REFLECTION; DESIGN;
D O I
10.1016/j.cl.2014.02.002
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The ability to annotate code and, in general, the capability to attach arbitrary meta-data to portions of a program are features that have become more and more common in programming languages. Annotations in Java make it possible to attach custom, structured meta-data to declarations of classes, fields and methods. However, the mechanism has some limits: annotations can only decorate declarations and their instantiation can only be resolved statically. With this work, we propose an extension to Java (named @Java) with a richer annotation model, supporting code block and expression annotations, as well as dynamically evaluated members. In other words, in our model, the granularity of annotations extends to the statement and expression level and annotations may hold the result of runtime-evaluated expressions. Our extension to the Java annotation model is twofold: (i) we introduced block and expression annotations and (ii) we allow every annotation to hold dynamically evaluated values. Our implementation also provides an extended reflection API to support inspection and retrieval of our enhanced annotations. (C) 2014 Elsevier Ltd. All rights reserved.
引用
收藏
页码:2 / 18
页数:17
相关论文
共 25 条
[1]  
Al-Refai M, 2014, P 29 ANN ACM S APPL
[2]  
CAZZOLA W, 2007, P 12 ANN ACM S APPL, P1275
[3]  
Cazzola W, 2013, P SAC 2013 COIMBR PO, P1691
[4]  
Cazzola W, 2013, MODELS RUN TIME
[5]  
Cazzola W., 2013, SAC 13 COIMBR PORT, P1709
[6]  
Cazzola W, 2005, J OBJECT TECHNOL, V4
[7]  
Cazzola W, 2013, LECT NOTES COMPUT SC, V8107, P271, DOI 10.1007/978-3-642-41533-3_17
[8]   Towards an industrial grade IVE for Java and next generation research platform for JML [J].
Chalin P. ;
Robby ;
James P.R. ;
Lee J. ;
Karabotsos G. .
International Journal on Software Tools for Technology Transfer, 2010, 12 (6) :429-446
[9]  
Chiba S, 2000, LECT NOTES COMPUT SC, V1850, P313
[10]   REVERSE ENGINEERING AND DESIGN RECOVERY - A TAXONOMY [J].
CHIKOFSKY, EJ ;
CROSS, JH .
IEEE SOFTWARE, 1990, 7 (01) :13-17