Annotation on Intersectingtype

Mohan Radhakrishnan radhakrishnan.mohan at gmail.com
Sun Jan 19 22:15:35 PST 2014


Subject was missed.

On Mon, Jan 20, 2014 at 11:44 AM, Mohan Radhakrishnan <
radhakrishnan.mohan at gmail.com> wrote:

> Hi,
>
>         I was trying to detect an intersection type and print the
> annotation only if it is. Is that possible ? I may be misunderstanding this.
>
>                Should I try this
> " if( typeMirror instanceof javax.lang.model.type.IntersectionType) { }" ?
>
>
>
> public class IntersectionType {
>
>     @Retention(RetentionPolicy.RUNTIME)
>     @Target(ElementType.TYPE_USE)
>     public @interface TypeUses {
>         TypeUse[] value();
>     }
>
>     @Retention(RetentionPolicy.RUNTIME)
>     @Target(ElementType.TYPE_USE)
>     @Repeatable(TypeUses.class)
>     protected @interface  TypeUse {
>         int value();
>     }
>
>     class Test<T extends String & @IntersectionType.TypeUse(value = 2)
> Serializable>{
>
>     }
>
>     class Test1<T extends @IntersectionType.TypeUse(value = 2)String>{
>
>     }
>
> }
>
> Thanks,
> Mohan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/type-annotations-dev/attachments/20140120/27fee336/attachment.html 


More information about the type-annotations-dev mailing list