if (cl == null)
cl = Thread.currentThread().getContextClassLoader();
try
{
TypeInfoFactory tif = configuration.getTypeInfoFactory();
if (metaType.isArray())
{
ArrayMetaType arrayMetaType = (ArrayMetaType)metaType;
MetaType elementMetaType = arrayMetaType.getElementType();
String elementTypeName = elementMetaType.getTypeName();
if (arrayMetaType.isPrimitiveArray())
elementTypeName = ArrayMetaType.getPrimitiveName(elementTypeName);
TypeInfo elementTypeInfo = tif.getTypeInfo(elementTypeName, cl);
int dimension = arrayMetaType.getDimension() - 1; // minus 1, since we already use first in next line
TypeInfo typeInfo = elementTypeInfo.getArrayType();
while(dimension > 0)
{
typeInfo = typeInfo.getArrayType();
dimension--;
}
return typeInfo;
}
return tif.getTypeInfo(metaType.getTypeName(), cl);
}
catch (ClassNotFoundException e)
{
throw new UndeclaredThrowableException(e);
}