This content has been marked as final.
Show 3 replies
-
1. Re: how to instantiate a generic/parameterized MC bean/POJO
csabaszucs Nov 11, 2009 5:59 AM (in response to csabaszucs)Sorry, here is the parameterized type again but I couldn't insert the less than and greater than characters:
public class TypedRegistry_T_ {
// ...
public TypedRegistry() {
// ...
}
} -
2. Re: how to instantiate a generic/parameterized MC bean/POJO
alesj Nov 11, 2009 6:19 AM (in response to csabaszucs)"CsabaSzucs" wrote:
So how shall I define the type parameter for the constructor in the XML descriptor?
Have a look at how we use SchemaResolverDeployer (e.g. in deployers.xml).
The deployer itself is parametrized, but once you define its output it becomes "more exact".
But what's the use case?
Generics are only helpful at compile time,
since at runtime they are forgotten anyway. -
3. Re: how to instantiate a generic/parameterized MC bean/POJO
csabaszucs Nov 11, 2009 7:59 AM (in response to csabaszucs)But what if I don't have that output variable in the constructor...like in the default constructor of the parameterized class?
In Java syntax the parameter type is inferred in the instantiation command.
In my case, the parameter type can only be inferred from the instance methods of the class.
Csaba