private Class checkParamType ( Type genParamType , final Method method , final int paramPos , final ClassLoader classLoader ) { Class paramClazz = null ; if ( genParamType instanceof ParameterizedType ) { ParameterizedType pType = ( ParameterizedType ) genParamType ; Type [ ] actualTypeArgs = pType . getActualTypeArguments ( ) ; // skip Map types. Don't know how to set default value for these if ( actualTypeArgs . length == 1 ) { try { paramClazz = classLoader . loadClass ( actualTypeArgs [ 0 ] . getTypeName ( ) ) ; } catch ( Exception ee ) { JAXRS_LOGGER . classIntrospectionFailure ( ee . getClass ( ) . getName ( ) , ee . getMessage ( ) ) ; } } } else { Class < ? > [ ] paramArr = method . getParameterTypes ( ) ; if ( paramArr [ paramPos ] . isArray ( ) ) { Class compClazz = paramArr [ paramPos ] . getComponentType ( ) ; if ( ! compClazz . isPrimitive ( ) ) { paramClazz = compClazz ; } } else { if ( ! paramArr [ paramPos ] . isPrimitive ( ) ) { paramClazz = paramArr [ paramPos ] ; } } } return paramClazz ; }
Take steps to properly identify the parameter s data type