read java Annotation field values from class

Discussion in 'Java' started by mani, Mar 1, 2012.

  1. mani

    mani Guest

    How to read java Annotation field values from reflect class.
    I am having a java class file Myclass.java. This file having the
    annotation

    @interface MyAnnotation {
    boolean DuplicateValues();
    boolean DuplicateVariables();
    }
    @MyAnnotation(DuplicateValues = true, DuplicateVariables = true)

    I need to get get value of DuplicateValues, DuplicateVariables, that
    means true,true from Myclass.class .
    mani, Mar 1, 2012
    #1
    1. Advertising

  2. mani

    Lew Guest

    On 03/01/2012 02:57 AM, mani wrote:
    > [Please explain] How to read java [sic] Annotation field values from reflect class.


    This is a repeated post. markspace gave a decent answer to the first post.

    > I am having a java [sic] class file Myclass.java.
    > This file having the annotation
    >
    > @interface MyAnnotation {
    > boolean DuplicateValues();
    > boolean DuplicateVariables();
    > }
    > @MyAnnotation(DuplicateValues = true, DuplicateVariables = true)
    >
    > I need to get get value of DuplicateValues, DuplicateVariables, that
    > means true,true from Myclass.class .


    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
    Lew, Mar 1, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Pilcher

    Check class file for annotation

    Ian Pilcher, Jan 23, 2006, in forum: Java
    Replies:
    6
    Views:
    832
    Ian Pilcher
    Jan 24, 2006
  2. pek
    Replies:
    2
    Views:
    1,052
  3. Tom Anderson
    Replies:
    1
    Views:
    319
    Tom Anderson
    May 10, 2009
  4. mani
    Replies:
    2
    Views:
    1,328
  5. Sound
    Replies:
    2
    Views:
    430
    Randy Webb
    Sep 28, 2006
Loading...

Share This Page