xiaodududu / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

It would be nice to have TypeLiteral as a standalone project #573

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've recently noticed the class TypeLiteral in Guice and found it to be 
incredibly useful as a patch on top of Java's limited and hard to use generics 
support. It's not only useful for things related to dependency injection so I 
think it deserves a project of its own.

I am currently using it as part of my mocking framework to support deep 
(recursive) mock structures for classes with generic type parameters, but I am 
not really using all of Guice for that, just the TypeLiteral class.

It would be nice to slim down the dependencies somewhat, and the TypeLiteral 
seems like a natural thing to split up from Guice.

Original issue reported on code.google.com by kristofer.karlsson@gmail.com on 22 Nov 2010 at 10:07

GoogleCodeExporter commented 9 years ago
For this purpose someone created the GenTyRef project on googlecode: 
http://code.google.com/p/gentyref/

It is available also on Maven Central Repo: 
http://mvnrepository.com/artifact/com.googlecode.gentyref/gentyref/1.1.0

Hope this helps!!!

Original comment by simone.t...@gmail.com on 22 Nov 2010 at 10:25

GoogleCodeExporter commented 9 years ago
Thank you! I hadn't seen that. It's not exactly like TypeLiteral in Guice, but 
I guess it's close enough for my purposes.

Original comment by kristofer.karlsson@gmail.com on 23 Nov 2010 at 7:29

GoogleCodeExporter commented 9 years ago
You're very welcome to make such a project... but it's unlikely Guice will 
require even more dependencies.

Original comment by sberlin on 19 Feb 2011 at 8:18