Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Why annotations are not exposed through JoinPoint.StaticPart?

OK, let me repeat, because I am slow. There is some internal AspectJ code
that runs during the compilation. This code can know what the annotations
are and theoretically could have injected the following code into the static
constructor:

typeAnnotations = new Annotation[2];
typeAnnotations[0] = new TypeAnnotation1("yaba daba doo");
typeAnnotations[1] = new TypeAnnotation2(3);

for a type annotated like so:

@TypeAnnotation1("yaba daba doo")
@TypeAnnotation2(3)
public class MyType {}

But "one can't new up annotations in an easy way", which I interpret as "one
cannot have a code like the above".

If I have grokked you correctly, then this is sad. Java annotations are not
like C# attributes after all.

--
View this message in context: http://aspectj.2085585.n4.nabble.com/Why-annotations-are-not-exposed-through-JoinPoint-StaticPart-tp4196637p4197257.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top