Request for revised terminology describing ways annotations can be present or not

Joe Darcy joe.darcy at oracle.com
Tue Mar 26 16:10:50 PDT 2013


Hello,

The JSR 296 API includes both a language model (javax.lang.model.*) and 
an API to define and interact with annotation processors 
(javax.annotation.processing).

The language model portion of the API has already been updated for 
repeating annotations by the addition of some new method which perform 
the container look through operations. With my JSR 269 maintenance lead 
hat on, I've started looking at how the annotation processing portion of 
the API should be amended to address repeating annotations.

In brief, and processing API requires that the set of annotations 
present on a body of code be computed. To preserve behavioral 
compatibility, "present" in this context means directly present in the 
source code or class file representation of a declaration or present via 
inheritance. Container look-through should *not* be considered.

I was hoping to describe this arrangement using the "directly present" 
and "present" terminology from java.lang.reflect.AnnotatedElement or 
javax.lang.model.AnnotatedConstruct. Unfortunately, those terms allow 
look though to occur based on which method is being called.

So what I'd like to have is a set of definition in the 
AnnotatedElement/AnnotatedConstruct types which support the following 
distinctions:

1) directly present (no inheritance, no container look through)
2) present directly or present indirectly via inheritance
3) present directly or present indirectly via container look through
4) present directly or via the supported interaction of inheritance and 
look through

Thanks,

-Joe



More information about the enhanced-metadata-spec-discuss mailing list