[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Install Items

adrian@jboss.org do-not-reply at jboss.com
Fri Apr 20 07:41:58 EDT 2007


Without seeing the context its hard to say. :-)

This is the way I have it working in some uncommitted code for the 
managed object stuff.


  |       if (typeInfo.isCollection())
  |          return generateCollection((ClassInfo) typeInfo);
  |    
  |    /**
  |     * Generate a collection metatype
  |     * 
  |     * @param typeInfo the type info
  |     * @return the metatype
  |     */
  |    public ArrayMetaType generateCollection(ClassInfo typeInfo)
  |    {
  |       TypeInfo elementType = objectTypeInfo;
  |       
  |       TypeInfo[] types = typeInfo.getActualTypeArguments();
  |       if (types != null)
  |          elementType = types[0];
  |       
  |       MetaType elementMetaType = resolve(elementType);
  |       return new ArrayMetaType(1, elementMetaType);
  |    }
  | 

Of course in that code, I fallback to java.lang.Object when it is not Generic. :-)

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

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



More information about the jboss-dev-forums mailing list