Do we need a CollectionMetaType/Value?
Since this code doesn't know anything about the actual Collection class:
From DefaultMetaValueFactory:
| else if (classInfo.isCollection())
| {
| Collection c = (Collection) value;
| oldArray = c.toArray();
| }
| else
| throw new UnsupportedOperationException("Cannot construct array for
" + value.getClass());
|
| array = createArray(elementType, componentType.getComponentType(), dimension,
oldArray);
|
And from DefaultMetaTypeFactory:
| /**
| * 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);
| }
|
Hence no way of unwrapping it.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111279#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...