Results 1 to 2 of 2
  1. #1
    athar is offline Member
    Join Date
    Feb 2013
    Posts
    10
    Rep Power
    0

    Default How to add annotations to getter and setter property?

    Hi
    I have define property as
    // Value Date
    public void setValueDate(String valDate)
    {
    sValueDate = valDate;
    }
    public String getValueDate()
    {
    return sValueDate;
    }
    I want to add annotation to check for nulls, length for validation purpose. How to add annotation ?
    Thanks in advance

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,142
    Rep Power
    10

    Default Re: How to add annotations to getter and setter property?

    What have you tried? Without more detail, the best we can do is point you here: https://www.google.com/search?q=java+annotations
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

Similar Threads

  1. getter and setter method using Jcreator
    By couline in forum New To Java
    Replies: 7
    Last Post: 01-22-2012, 03:02 PM
  2. help with getter and setter methods of this question.
    By luciawashaya in forum New To Java
    Replies: 6
    Last Post: 11-01-2011, 12:28 PM
  3. getter and setter method help please!
    By merdzins in forum New To Java
    Replies: 2
    Last Post: 12-06-2010, 06:06 AM
  4. use of private in getter and setter
    By katturv in forum New To Java
    Replies: 1
    Last Post: 12-03-2010, 08:17 PM
  5. Replies: 4
    Last Post: 01-01-2009, 01:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •