@ Nonnull protected Map < String , Object > resolveSubMap ( String name , Map < String , Object > entries , ArgumentConversionContext < ? > conversionContext , StringConvention keyConvention , MapFormat . MapTransformation transformation ) { final Argument < ? > valueType = conversionContext . getTypeVariable ( "V" ) . orElse ( Argument . OBJECT_ARGUMENT ) ; Map < String , Object > subMap = new LinkedHashMap <> ( entries . size ( ) ) ; String prefix = name + ' ' ; for ( Map . Entry < String , Object > entry : entries . entrySet ( ) ) { final String key = entry . getKey ( ) ; if ( key . startsWith ( prefix ) ) { String subMapKey = key . substring ( prefix . length ( ) ) ; Object value = resolvePlaceHoldersIfNecessary ( entry . getValue ( ) ) ; if ( transformation == MapFormat . MapTransformation . FLAT ) { subMapKey = keyConvention . format ( subMapKey ) ; value = conversionService . convert ( value , valueType ) . orElse ( null ) ; subMap . put ( subMapKey , value ) ; } else { processSubmapKey ( subMap , subMapKey , value , keyConvention ) ; } } } return subMap ; }
Resolves a submap for the given name and parameters .