• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting Dynamic element values in an Annotation

 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi Guys,

I was wondering if it is possible supply values to an annotation dynamically. Say I want the default message in the above piece of code to come from an Database Entity POJO. Is it possible to do this? If yes, how. Just a nudge in the right direction.

is it possible to set these values in the Validation class' initialize method?

Thanks.
 
Anantha Sharma
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't think it is possible... the values provided to any annotation is computed at compile time & not at runtime also the value provided must be constant, so its not possible to have the value come from a database..

 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!