jaxrs/src/main/java/org/jboss/as/jaxrs/deployment/JaxrsMethodParameterProcessor.java
private HashMap<String, List<Validator>>  getParamConverters(
            final CompositeIndex index, final ClassLoader classLoader,
            Set<String> knownProviderClasses, boolean isFromUnitTest) {

        HashMap<String, List<Validator>> paramConverterMap = new HashMap<>();
        List<Validator> converterProviderList = new ArrayList<>();
        paramConverterMap.put(Object.class.getName(), converterProviderList);

        Set<ClassInfo> paramConverterSet = new HashSet<ClassInfo>();
        if(isFromUnitTest) {
            Indexer indexer = new Indexer();
            for (String className : knownProviderClasses) {
                try {
                    String pathName = className.replace(".", File.separator);
                    InputStream stream = classLoader.getResourceAsStream(
                            pathName + ".class");
                    indexer.index(stream);
                    stream.close();
                } catch (IOException e) {
                    JAXRS_LOGGER.classIntrospectionFailure(e.getClass().getName(),
                            e.getMessage());
                }
            }

            List<ClassInfo> paramConverterList =
                    indexer.complete().getKnownDirectImplementors(PARAM_CONVERTER_DOTNAME);
            List<ClassInfo> paramConverterProviderList =
                    indexer.complete().getKnownDirectImplementors(PARAM_CONVERTER_PROVIDER_DOTNAME);
            paramConverterSet.addAll(paramConverterList);
            paramConverterSet.addAll(paramConverterProviderList);

        } else {

            for (String clazzName : knownProviderClasses) {
                ClassInfo classInfo = index.getClassByName(DotName.createSimple(clazzName));
                if (classInfo != null) {
                    List<DotName> intfNamesList = classInfo.interfaceNames();
                    for (DotName dotName : intfNamesList) {
                        if (dotName.compareTo(PARAM_CONVERTER_DOTNAME) == 0
                                || dotName.compareTo(PARAM_CONVERTER_PROVIDER_DOTNAME) == 0) {
                            paramConverterSet.add(classInfo);
                            break;
                        }
                    }
                }
            }
        }

        for (ClassInfo classInfo : paramConverterSet) {

            Class<?> clazz = null;
            Method method = null;
            try {
                String clazzName = classInfo.name().toString();
                if (clazzName.endsWith("$1")) {
                    clazzName = clazzName.substring(0, clazzName.length()-2);
                }

                clazz = classLoader.loadClass(clazzName);
                Constructor<?> ctor = clazz.getConstructor();
                Object object = ctor.newInstance();

                List<AnnotationInstance> lazyLoadAnnotations =classInfo
                        .annotations().get(PARAM_CONVERTER_LAZY_DOTNAME);

                if (object instanceof ParamConverterProvider) {
                    ParamConverterProvider pcpObj = (ParamConverterProvider) object;
                    method = pcpObj.getClass().getMethod(
                            "getConverter",
                            Class.class,
                            Type.class,
                            Annotation[].class);
                    converterProviderList.add(new ConverterProvider(pcpObj, method, lazyLoadAnnotations));
                }

                if (object instanceof ParamConverter) {
                    ParamConverter pc = (ParamConverter) object;
                    method = getFromStringMethod(pc.getClass());
                    Class<?> returnClazz = method.getReturnType();
                    List<Validator> verifiers = paramConverterMap.get(returnClazz.getName());
                    PConverter pConverter = new PConverter(pc, method, lazyLoadAnnotations);
                    if (verifiers == null){
                        List<Validator> vList = new ArrayList<>();
                        vList.add(pConverter);
                        paramConverterMap.put(returnClazz.getName(), vList);
                    } else {
                        verifiers.add(pConverter);
                    }
                }

            } catch(NoSuchMethodException nsne) {
                JAXRS_LOGGER.classIntrospectionFailure(nsne.getClass().getName(),
                        nsne.getMessage());
            } catch (Exception e) {
                JAXRS_LOGGER.classIntrospectionFailure(e.getClass().getName(),
                        e.getMessage());
            }
        }

        return paramConverterMap;
    }
private HashMap<String, List<Validator>>  getParamConverters(
            final CompositeIndex index, final ClassLoader classLoader,
            Set<String> knownProviderClasses, boolean isFromUnitTest) {

        HashMap<String, List<Validator>> paramConverterMap = new HashMap<>();
        List<Validator> converterProviderList = new ArrayList<>();
        paramConverterMap.put(Object.class.getName(), converterProviderList);

        Set<ClassInfo> paramConverterSet = new HashSet<ClassInfo>();
        if(isFromUnitTest) {
            Indexer indexer = new Indexer();
            for (String className : knownProviderClasses) {
                try {
                    String pathName = className.replace(".", File.separator);
                    InputStream stream = classLoader.getResourceAsStream(
                            pathName + ".class");
                    indexer.index(stream);
                    stream.close();
                } catch (IOException e) {
                    JAXRS_LOGGER.classIntrospectionFailure(e.getClass().getName(),
                            e.getMessage());
                }
            }

            List<ClassInfo> paramConverterList =
                    indexer.complete().getKnownDirectImplementors(PARAM_CONVERTER_DOTNAME);
            List<ClassInfo> paramConverterProviderList =
                    indexer.complete().getKnownDirectImplementors(PARAM_CONVERTER_PROVIDER_DOTNAME);
            paramConverterSet.addAll(paramConverterList);
            paramConverterSet.addAll(paramConverterProviderList);

        } else {

            for (String clazzName : knownProviderClasses) {
                ClassInfo classInfo = index.getClassByName(DotName.createSimple(clazzName));
                if (classInfo != null) {
                    List<DotName> intfNamesList = classInfo.interfaceNames();
                    for (DotName dotName : intfNamesList) {
                        if (dotName.compareTo(PARAM_CONVERTER_DOTNAME) == 0
                                || dotName.compareTo(PARAM_CONVERTER_PROVIDER_DOTNAME) == 0) {
                            paramConverterSet.add(classInfo);
                            break;
                        }
                    }
                }
            }
        }

        for (ClassInfo classInfo : paramConverterSet) {

            Class<?> clazz = null;
            Method method = null;
            try {
                String clazzName = classInfo.name().toString();
                if (clazzName.endsWith("$1")) {
                    clazzName = clazzName.substring(0, clazzName.length()-2);
                }

                clazz = classLoader.loadClass(clazzName);
                Constructor<?> ctor = clazz.getConstructor();
                Object object = ctor.newInstance();

                List<AnnotationInstance> lazyLoadAnnotations =classInfo
                        .annotations().get(PARAM_CONVERTER_LAZY_DOTNAME);

                if (object instanceof ParamConverterProvider) {
                    ParamConverterProvider pcpObj = (ParamConverterProvider) object;
                    method = pcpObj.getClass().getMethod(
                            "getConverter",
                            Class.class,
                            Type.class,
                            Annotation[].class);
                    converterProviderList.add(new ConverterProvider(pcpObj, method, lazyLoadAnnotations));
                }

                if (object instanceof ParamConverter) {
                    ParamConverter pc = (ParamConverter) object;
                    method = getFromStringMethod(pc.getClass());
                    Class<?> returnClazz = method.getReturnType();
                    List<Validator> verifiers = paramConverterMap.get(returnClazz.getName());
                    PConverter pConverter = new PConverter(pc, method, lazyLoadAnnotations);
                    if (verifiers == null){
                        List<Validator> vList = new ArrayList<>();
                        vList.add(pConverter);
                        paramConverterMap.put(returnClazz.getName(), vList);
                    } else {
                        verifiers.add(pConverter);
                    }
                }

            } catch(NoSuchMethodException nsne) {
                JAXRS_LOGGER.classIntrospectionFailure(nsne.getClass().getName(),
                        nsne.getMessage());
            } catch (Exception e) {
                JAXRS_LOGGER.classIntrospectionFailure(e.getClass().getName(),
                        e.getMessage());
            }
        }

        return paramConverterMap;
    }
private HashMap < String , List < Validator > > getParamConverters ( final CompositeIndex index , final ClassLoader classLoader , Set < String > knownProviderClasses , boolean isFromUnitTest ) { HashMap < String , List < Validator > > paramConverterMap = new HashMap <> ( ) ; List < Validator > converterProviderList = new ArrayList <> ( ) ; paramConverterMap . put ( Object . class . getName ( ) , converterProviderList ) ; Set < ClassInfo > paramConverterSet = new HashSet < ClassInfo > ( ) ; if ( isFromUnitTest ) { Indexer indexer = new Indexer ( ) ; for ( String className : knownProviderClasses ) { try { String pathName = className . replace ( "." , File . separator ) ; InputStream stream = classLoader . getResourceAsStream ( pathName + ".class" ) ; indexer . index ( stream ) ; stream . close ( ) ; } catch ( IOException e ) { JAXRS_LOGGER . classIntrospectionFailure ( e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } } List < ClassInfo > paramConverterList = indexer . complete ( ) . getKnownDirectImplementors ( PARAM_CONVERTER_DOTNAME ) ; List < ClassInfo > paramConverterProviderList = indexer . complete ( ) . getKnownDirectImplementors ( PARAM_CONVERTER_PROVIDER_DOTNAME ) ; paramConverterSet . addAll ( paramConverterList ) ; paramConverterSet . addAll ( paramConverterProviderList ) ; } else { for ( String clazzName : knownProviderClasses ) { ClassInfo classInfo = index . getClassByName ( DotName . createSimple ( clazzName ) ) ; if ( classInfo != null ) { List < DotName > intfNamesList = classInfo . interfaceNames ( ) ; for ( DotName dotName : intfNamesList ) { if ( dotName . compareTo ( PARAM_CONVERTER_DOTNAME ) == 0 || dotName . compareTo ( PARAM_CONVERTER_PROVIDER_DOTNAME ) == 0 ) { paramConverterSet . add ( classInfo ) ; break ; } } } } } for ( ClassInfo classInfo : paramConverterSet ) { Class < ? > clazz = null ; Method method = null ; try { String clazzName = classInfo . name ( ) . toString ( ) ; if ( clazzName . endsWith ( "$1" ) ) { clazzName = clazzName . substring ( 0 , clazzName . length ( ) - 2 ) ; } clazz = classLoader . loadClass ( clazzName ) ; Constructor < ? > ctor = clazz . getConstructor ( ) ; Object object = ctor . newInstance ( ) ; List < AnnotationInstance > lazyLoadAnnotations = classInfo . annotations ( ) . get ( PARAM_CONVERTER_LAZY_DOTNAME ) ; if ( object instanceof ParamConverterProvider ) { ParamConverterProvider pcpObj = ( ParamConverterProvider ) object ; method = pcpObj . getClass ( ) . getMethod ( "getConverter" , Class . class , Type . class , Annotation [ ] . class ) ; converterProviderList . add ( new ConverterProvider ( pcpObj , method , lazyLoadAnnotations ) ) ; } if ( object instanceof ParamConverter ) { ParamConverter pc = ( ParamConverter ) object ; method = getFromStringMethod ( pc . getClass ( ) ) ; Class < ? > returnClazz = method . getReturnType ( ) ; List < Validator > verifiers = paramConverterMap . get ( returnClazz . getName ( ) ) ; PConverter pConverter = new PConverter ( pc , method , lazyLoadAnnotations ) ; if ( verifiers == null ) { List < Validator > vList = new ArrayList <> ( ) ; vList . add ( pConverter ) ; paramConverterMap . put ( returnClazz . getName ( ) , vList ) ; } else { verifiers . add ( pConverter ) ; } } } catch ( NoSuchMethodException nsne ) { JAXRS_LOGGER . classIntrospectionFailure ( nsne . getClass ( ) . getName ( ) , nsne . getMessage ( ) ) ; } catch ( Exception e ) { JAXRS_LOGGER . classIntrospectionFailure ( e . getClass ( ) . getName ( ) , e . getMessage ( ) ) ; } } return paramConverterMap ; }
Create a list of ParamConverters and ParamConverterProviders present
in the application.

When running unitTest the classes must be indexed.  In normal deployment
the indexing is already done.

@param index
@param classLoader
@return
Create a list of ParamConverters and ParamConverterProviders present in the application .