You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-dev@jakarta.apache.org by Dave Brosius <db...@qis.net> on 2005/02/03 03:45:05 UTC

Annotation Attributes

I am starting to look at putting Annotation attribute support into BCEL. 
There are two types of Annotation attributes, with
two different string constants.

RuntimeVisibleAnnotations - those found in class files, and loaded by the 
JVM
RuntimeInvisibleAnnotations - those found in class files, but not loaded by 
the JVM.

I am thinking that I will just create one Annotation attribute class in 
BCEL, and allow for querying wheither this attribute is runtime visible or 
not.

Does anyone see a problem with this?






---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Re: Annotation Attributes

Posted by Conor MacNeill <co...@apache.org>.
Dave Brosius wrote:
> I am starting to look at putting Annotation attribute support into BCEL. 
> There are two types of Annotation attributes, with
> two different string constants.
> 
> RuntimeVisibleAnnotations - those found in class files, and loaded by 
> the JVM
> RuntimeInvisibleAnnotations - those found in class files, but not loaded 
> by the JVM.
> 
> I am thinking that I will just create one Annotation attribute class in 
> BCEL, and allow for querying wheither this attribute is runtime visible 
> or not.
> 
> Does anyone see a problem with this?
> 

Sounds fine to me.

Conor

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Re: Annotation Attributes

Posted by Dave Brosius <db...@qis.net>.
> ----- Original Message ----- 
> From: "Simon Kitching" <sk...@apache.org>
>
>
>> Well, the other question we need to ask is: will there be other types of
>> annotation in future (Transparent, Foggy, ???). If so, then subclasses
>> are better than a boolean.

Hmm, after further discovery, the design of BCELs Attributes sort of force 
me down a inheritance solution anyway.

So thats my current plan. 



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Re: Annotation Attributes

Posted by Dave Brosius <db...@qis.net>.
----- Original Message ----- 
From: "Simon Kitching" <sk...@apache.org>


> Well, the other question we need to ask is: will there be other types of
> annotation in future (Transparent, Foggy, ???). If so, then subclasses
> are better than a boolean.

Well, there is one more type, that is RetentionPolicy.SOURCE

Of course, this means that these types of annotations are stripped by the 
compiler, and so bcel never sees them.

I suppose if i start with one class, it wouldn't be that hard to add 
derivation in the future. 



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Re: Annotation Attributes

Posted by Simon Kitching <sk...@apache.org>.
Well, the other question we need to ask is: will there be other types of
annotation in future (Transparent, Foggy, ???). If so, then subclasses
are better than a boolean.

I can't think of any likely new types, though. If nobody else can, then
I'm happy for a single class to represent both types of Annotation;
after all, BCEL is quite heavy enough already!

By the way, I personally prefer "bottom-posting" (replies follow
original) rather than "top-posting" (reply above original). It really
helps when people want to pick up a thread part-way through. And helps
when an email has more than one topic. Of course that's just my personal
opinion...

Regards,

Simon

On Wed, 2005-02-02 at 22:06 -0500, Dave Brosius wrote:
> As far as I can tell, they are the same.
> 
> 
> > Are there operations that are valid on Visible annotations that are not
> > valid on invisible ones? If so, that would suggest using multiple
> > classes. If not, then I guess I'll stay firmly on the fence :-)
> > 
> > 
> > Cheers,
> > 
> > Simon
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bcel-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Re: Annotation Attributes

Posted by Dave Brosius <db...@qis.net>.
As far as I can tell, they are the same.


> Are there operations that are valid on Visible annotations that are not
> valid on invisible ones? If so, that would suggest using multiple
> classes. If not, then I guess I'll stay firmly on the fence :-)
> 
> 
> Cheers,
> 
> Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Re: Annotation Attributes

Posted by Simon Kitching <sk...@apache.org>.
On Wed, 2005-02-02 at 21:45 -0500, Dave Brosius wrote:
> I am starting to look at putting Annotation attribute support into BCEL. 
> There are two types of Annotation attributes, with
> two different string constants.
> 
> RuntimeVisibleAnnotations - those found in class files, and loaded by the 
> JVM
> RuntimeInvisibleAnnotations - those found in class files, but not loaded by 
> the JVM.
> 
> I am thinking that I will just create one Annotation attribute class in 
> BCEL, and allow for querying wheither this attribute is runtime visible or 
> not.
> 
> Does anyone see a problem with this?

Hmm .. pragmatism vs clean design. 

The clean design would have a parent Annotation class, then subclasses
for Visible and Invisible, yes? But this would increase the BCEL library
by the size of two additional classes.

Are there operations that are valid on Visible annotations that are not
valid on invisible ones? If so, that would suggest using multiple
classes. If not, then I guess I'll stay firmly on the fence :-)


Cheers,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org