private static void handleSingletonList(String key, List<Object> value) throws Exception {

        List<String> interfaceClasses = new ArrayList();
        if(key.contains(",")) {
            String[] interfaces = key.split(",");
            interfaceClasses.addAll(Arrays.asList(interfaces));
        } else {
            interfaceClasses.add(key);
        }
        // the value can be a list of implementation class names or a map.
        if(value != null && value.size() == 1) {
            handleSingleImpl(interfaceClasses, value);
        } else {
            handleMultipleImpl(interfaceClasses, value);
        }
    }
private static void handleSingletonList ( String key , List < Object > value ) throws Exception { List < String > interfaceClasses = new ArrayList ( ) ; if ( key . contains ( "," ) ) { String [ ] interfaces = key . split ( "," ) ; interfaceClasses . addAll ( Arrays . asList ( interfaces ) ) ; } else { interfaceClasses . add ( key ) ; } if ( value != null && value . size ( ) == 1 ) { handleSingleImpl ( interfaceClasses , value ) ; } else { handleMultipleImpl ( interfaceClasses , value ) ; } }
For each singleton definition, create object for the interface with the implementation class,
and push it into the service map with key and implemented object.
@param key String interface or multiple interface separated by ","
@param value List of implementations of interface(s) defined in the key
@throws Exception exception thrown from the object creation