Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

knowing a method's return type annotations?  RSS feed

 
Elhanan Maayan
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..

is there a way i can create a function that will know it's return type annoations? i'm pretty i need to do it with generics.


the thing is , we have an api which retrieves an object from a cache region, and the object's class has an annotation which states which region to put it in.
the put in cache method doesn't present a problem, but, the get from cache method does, as originally it doesn't have a type to reference from.

i could always do it in hibernate style (i.e it's get/load method signature public Object load(Class clz,Serilzable id), but that's ugly.

any ideas?
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for us beginners. Moving.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!