[jboss-dev] generic collection item type
Ales Justin
ales.justin at gmail.com
Mon Jul 30 05:48:37 EDT 2007
You're right.
You need superclass.
I had a superclass/interface reference, but the instance was similar to
yours. That's why it worked for me.
>> configuration.getTypeInfo(...) may be a wrong way to load a generic
type
but even if I declare a field of type JBossEnterpriseBeansMetaData and
But I don't understand this.
Cheers,
Ales
>>>>>>>>>>
No, it won't.
This
ClassInfo classInfo = (ClassInfo)
configuration.getTypeInfo(JBossEnterpriseBeansMetaData.class);
System.out.println("isCollection: " + classInfo.isCollection());
System.out.println("type args: " +
classInfo.getActualTypeArguments());
System.out.println("superclass args: " +
Arrays.asList(classInfo.getGenericSuperclass().getActualTypeArguments()));
results in
isCollection: true
type args: null
superclass args:
[ReflectClassInfoImpl at f38798{name=org.jboss.ejb.metadata.spec.EnterpriseBeanMetaData},
ReflectClassInfoImpl at 4b222f{name=org.jboss.ejb.metadata.jboss.JBossEnterpriseBeanMetaData},
ReflectClassInfoImpl at b169f8{name=org.jboss.ejb.metadata.spec.EnterpriseBeansMetaData}]
More information about the jboss-development
mailing list