Friday, 12. June 2009

java reflection on generics

When you drill down far into Java reflection, you end up at the reflection class for generic types. This is, if you have

class Blah {
  T t;
  public T get() { return t; }
}
... Blah stringBlah = new Blah();
Then you can get the configured return type "String" by reflecting on the method "get". The return type of that method is String. BUT if you need the generic variable T of Blah, you end up calling Blah.class.getTypeParameters(). And here the fun starts in the doc of TypeVariable:

The type parameter D represents the type of generic declaration that declared the underlying type variable.

wtf? this is as complex as playing braid.
QR barcode by i-nigma.com/CreateBarcodes

Trackback URL:
http://leobard.twoday.net/stories/5759235/modTrackback

icon

semantic weltbild 2.0

Building the Semantic Web is easier together

and then...

foaf explorer
foaf

Geo Visitors Map
I am a hard bloggin' scientist. Read the Manifesto.
www.flickr.com
lebard's photos More of lebard's photos
Skype Me™!

Search

 

Users Status

You are not logged in.

I support

Wikipedia Affiliate Button

Archive

June 2009
Sun
Mon
Tue
Wed
Thu
Fri
Sat
 
 1 
 2 
 3 
 4 
 6 
 7 
 9 
10
11
13
14
15
16
18
21
23
24
25
26
27
28
29
30
 
 
 
 
 

Credits

vi knallgrau GmbH

powered by Antville powered by Helma


Creative Commons License

xml version of this page
xml version of this page (with comments)

twoday.net AGB


austriaca
Chucknorrism
digitalcouch
gnowsis
Jesus
NeueHeimat
route planning
SemWeb
travel
zoot
Profil
Logout