No subject

Mohan Radhakrishnan radhakrishnan.mohan at gmail.com
Sun Jan 19 22:14:42 PST 2014


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/a098af04/attachment.html 


More information about the type-annotations-dev mailing list