Class<?> propType = javaClass.getComponentType();
Type genericPropType = propType;
if (genericType instanceof GenericArrayType) {
genericPropType = ((GenericArrayType)genericType).getGenericComponentType();
}
DataType dt = new DataTypeImpl(null, propType, genericPropType, XMLType.UNKNOWN);
property.setDataType(dt);
} else {
if (genericType instanceof ParameterizedType) {
// Collection<BaseType> property;
Type genericPropType = ((ParameterizedType)genericType).getActualTypeArguments()[0];
Class<?> propType = JavaIntrospectionHelper.getErasure(genericPropType);
DataType dt = new DataTypeImpl(null, propType, genericPropType, XMLType.UNKNOWN);
property.setDataType(dt);
} else {
// Collection property;
DataType dt = new DataTypeImpl(null, Object.class, Object.class, XMLType.UNKNOWN);
property.setDataType(dt);
}
}
} else {
DataType dt = new DataTypeImpl(null, javaClass, genericType, XMLType.UNKNOWN);
property.setDataType(dt);
}
return property;
}