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 ) ; } }
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 .