public Object[] convert(
BasicDBList source, JavaType targetType, ConversionContext context, TypeConversionHints hints)
throws ConversionException {
// get component type of array
JavaType componentType = null;
Type[] types = hints.get(TypeConversionHints.HINT_GENERIC_TYPE_PARAMETERS);
if (types!=null && types.length>0) {
componentType = JavaType.fromType(types[0]);
}
if (componentType==null) {
componentType = targetType.getComponentJavaType();
}
// bail if we don't have a component type
if (componentType==null) {
throw new ConversionException(
"Unable to determine componentType of "+targetType);
}
// create array
Object ret = Array.newInstance(componentType.asClass(), source.size());
// iterate and convert
for (int i=0; i<source.size(); i++) {
Object value = source.get(i);
if (value!=null) {