[jboss-dev-forums] [Design of JBossXB] - Re: Using generics info in CollectionPropertyHandler

alesj do-not-reply at jboss.com
Tue Nov 25 04:50:35 EST 2008


I've added TypeInfo::isInstance(Object) to JBoss Reflect,
so check if it is already available when you implement this:

  | if (componentType != null)
  |             {
  |                TypeInfoFactory tif = componentType.getTypeInfoFactory();
  |                TypeInfo childTypeInfo = tif.getTypeInfo(child.getClass());
  |                if (componentType.isAssignableFrom(childTypeInfo) == false)
  |                   throw new IllegalArgumentException("Illegal child type");
  |             }
  | 
vs.

  | if (componentType != null && componentType.isInstance(child) == false)
  |             {
  |                   throw new IllegalArgumentException("Illegal child type");
  |             }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192006#4192006

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192006



More information about the jboss-dev-forums mailing list