private AbstractChainedResourceBundlePostProcessor addOrCreateChain ( AbstractChainedResourceBundlePostProcessor chain , String key ) { AbstractChainedResourceBundlePostProcessor toAdd ; if ( customPostProcessors . get ( key ) == null ) { toAdd = buildProcessorByKey ( key ) ; if ( toAdd instanceof BundlingProcessLifeCycleListener && ! listeners . contains ( toAdd ) ) { listeners . add ( ( BundlingProcessLifeCycleListener ) toAdd ) ; } } else { toAdd = ( AbstractChainedResourceBundlePostProcessor ) customPostProcessors . get ( key ) ; } AbstractChainedResourceBundlePostProcessor newChainResult = null ; if ( chain == null ) { newChainResult = toAdd ; } else { chain . addNextProcessor ( toAdd ) ; newChainResult = chain ; } return newChainResult ; }
Creates an AbstractChainedResourceBundlePostProcessor . If the supplied chain is null the new chain is returned . Otherwise it is added to the existing chain .