I don't think the extra type checking you have above is really necessary.  Simply using DataType.compare(Object o1, Object o) should be sufficient.