PROPOSAL: Compiletime information access

rssh at rssh at
Tue Mar 24 10:22:16 PDT 2009

> rssh at wrote:
>> AUTHOR:  Ruslan Shevchenko
>>    Add API to access compile-time context of current compiled element
>> from
>>  programs and annotation processors.
>>    Now compile time properties are unaccessible for programmer. This
>> meaning
> No, this flavor information has been officially accessible for
> programmers using Java SE 6 compilers, which are required to support
> annotation processing and the JSR 199 tools API.  See the
> javax.annotation.processing and packages, which use
> javax.lang.model.
> The view of a type provided by JSR 269 annotation processing is
> read-only, but much of the effect of modifying the file can be had by
> either generating subclasses or the superclass of the type in question.
> These APIs don't provide a direct notion of location, but the Messager
> accepts the model of a program element to emit location information.
> -Joe

 Thanks for clarify; actually only fileName, lineNumber, className,
methodName and bindings can't be build with annotation processors. (all
those require context of location inside class be available).
So, this can be rewritten as:

 Now compile time properties which depends from local compilation context
(i.e. source location and variable bindings) are unaccessible for

Yet one question  to community - may be better left in proposal only
methods, which provide information, unaccessible from annotations
(getFileName(); getLineIndex(); getClassName(); getMethodName(); 
 and others (exec and eval) left to annotation processors, which can be
easy constructed ?

More information about the coin-dev mailing list