當前位置: 首頁>>代碼示例>>Java>>正文


Java ListUtils.removeAll方法代碼示例

本文整理匯總了Java中org.apache.commons.collections.ListUtils.removeAll方法的典型用法代碼示例。如果您正苦於以下問題:Java ListUtils.removeAll方法的具體用法?Java ListUtils.removeAll怎麽用?Java ListUtils.removeAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.collections.ListUtils的用法示例。


在下文中一共展示了ListUtils.removeAll方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fileChanged

import org.apache.commons.collections.ListUtils; //導入方法依賴的package包/類
/**
 * Call back when a dictionary file is changed. Calls the spring bean reader
 * to reload the file (which will override beans as necessary and destroy
 * singletons) and runs the indexer
 *
 * @see no.geosoft.cc.io.FileListener#fileChanged(java.io.File)
 */
public void fileChanged(File file) {
    LOG.info("reloading dictionary configuration for " + file.getName());
    try {
        List<String> beforeReloadBeanNames = Arrays.asList(ddBeans.getBeanDefinitionNames());
        
        Resource resource = new FileSystemResource(file);
        xmlReader.loadBeanDefinitions(resource);
        
        List<String> afterReloadBeanNames = Arrays.asList(ddBeans.getBeanDefinitionNames());
        
        List<String> addedBeanNames = ListUtils.removeAll(afterReloadBeanNames, beforeReloadBeanNames);
        String namespace = KRADConstants.DEFAULT_NAMESPACE;
        if (fileToNamespaceMapping.containsKey(file.getAbsolutePath())) {
            namespace = fileToNamespaceMapping.get(file.getAbsolutePath());
        }

        ddIndex.addBeanNamesToNamespace(namespace, addedBeanNames);

        performDictionaryPostProcessing(true);
    } catch (Exception e) {
        LOG.info("Exception in dictionary hot deploy: " + e.getMessage(), e);
    }
}
 
開發者ID:kuali,項目名稱:rice,代碼行數:31,代碼來源:ReloadingDataDictionary.java

示例2: urlContentChanged

import org.apache.commons.collections.ListUtils; //導入方法依賴的package包/類
public void urlContentChanged(final URL url) {
    LOG.info("reloading dictionary configuration for " + url.toString());
    try {
        InputStream urlStream = url.openStream();
        InputStreamResource resource = new InputStreamResource(urlStream);

        List<String> beforeReloadBeanNames = Arrays.asList(ddBeans.getBeanDefinitionNames());
        
        int originalValidationMode = xmlReader.getValidationMode();
        xmlReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
        xmlReader.loadBeanDefinitions(resource);
        xmlReader.setValidationMode(originalValidationMode);
        
        List<String> afterReloadBeanNames = Arrays.asList(ddBeans.getBeanDefinitionNames());
        
        List<String> addedBeanNames = ListUtils.removeAll(afterReloadBeanNames, beforeReloadBeanNames);
        String namespace = KRADConstants.DEFAULT_NAMESPACE;
        if (urlToNamespaceMapping.containsKey(url.toString())) {
            namespace = urlToNamespaceMapping.get(url.toString());
        }

        ddIndex.addBeanNamesToNamespace(namespace, addedBeanNames);

        performDictionaryPostProcessing(true);
    } catch (Exception e) {
        LOG.info("Exception in dictionary hot deploy: " + e.getMessage(), e);
    }
}
 
開發者ID:kuali,項目名稱:rice,代碼行數:29,代碼來源:ReloadingDataDictionary.java

示例3: removePartialsThatDoNotCorrespondToTheCurrentConfigReposList

import org.apache.commons.collections.ListUtils; //導入方法依賴的package包/類
private List<PartialConfig> removePartialsThatDoNotCorrespondToTheCurrentConfigReposList(List<PartialConfig> partList) {
    List<Object> notToBeMerged = new ArrayList<>();
    for (PartialConfig partialConfig : partList) {
        if (partialConfig.getOrigin() instanceof RepoConfigOrigin) {
            RepoConfigOrigin origin = (RepoConfigOrigin) partialConfig.getOrigin();
            if (!configRepos.hasMaterialWithFingerprint(origin.getMaterial().getFingerprint()))
                notToBeMerged.add(partialConfig);
        }
    }
    partList = ListUtils.removeAll(partList, notToBeMerged);
    return partList;
}
 
開發者ID:gocd,項目名稱:gocd,代碼行數:13,代碼來源:BasicCruiseConfig.java

示例4: loadDictionaryBeans

import org.apache.commons.collections.ListUtils; //導入方法依賴的package包/類
/**
 * Populates and processes the dictionary bean factory based on the configured files
 *
 * @param beans - The bean factory for the dictionary bean
 * @param moduleDictionaryFiles - List of bean xml files
 * @param index - Index of the data dictionary beans
 * @param validationFiles - The List of bean xml files loaded into the bean file
 */
public void loadDictionaryBeans(KualiDefaultListableBeanFactory beans,
        Map<String, List<String>> moduleDictionaryFiles, DataDictionaryIndex index,
        ArrayList<String> validationFiles) {
    // expand configuration locations into files
    LOG.info("Starting DD XML File Load");

    List<String> allBeanNames = new ArrayList<String>();
    for (String namespaceCode : moduleLoadOrder) {
        List<String> moduleDictionaryLocations = moduleDictionaryFiles.get(namespaceCode);

        if (moduleDictionaryLocations == null) {
           continue;
        }

        XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(beans);

        String configFileLocationsArray[] = new String[moduleDictionaryLocations.size()];
        configFileLocationsArray = moduleDictionaryLocations.toArray(configFileLocationsArray);
        for (int i = 0; i < configFileLocationsArray.length; i++) {
            validationFiles.add(configFileLocationsArray[i]);
        }

        try {
            xmlReader.loadBeanDefinitions(configFileLocationsArray);

            // get updated bean names from factory and compare to our previous list to get those that
            // were added by the last namespace
            List<String> addedBeanNames = Arrays.asList(beans.getBeanDefinitionNames());
            addedBeanNames = ListUtils.removeAll(addedBeanNames, allBeanNames);
            index.addBeanNamesToNamespace(namespaceCode, addedBeanNames);

            allBeanNames.addAll(addedBeanNames);
        } catch (Exception e) {
            throw new DataDictionaryException("Error loading bean definitions: " + e.getLocalizedMessage());
        }
    }

    LOG.info("Completed DD XML File Load");
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:48,代碼來源:DataDictionary.java

示例5: loadDictionaryBeans

import org.apache.commons.collections.ListUtils; //導入方法依賴的package包/類
/**
 * Populates and processes the dictionary bean factory based on the configured files
 *
 * @param beans - The bean factory for the dictionary bean
 * @param moduleDictionaryFiles - List of bean xml files
 * @param index - Index of the data dictionary beans
 */
public void loadDictionaryBeans(DefaultListableBeanFactory beans,
        Map<String, List<Resource>> moduleDictionaryFiles, DataDictionaryIndex index) {
    // expand configuration locations into files
    timer.start("XML File Loading");
    LOG.info("Starting DD XML File Load");

    List<String> allBeanNames = new ArrayList<>();
    for (String namespaceCode : moduleLoadOrder) {
        LOG.info( "Processing Module: " + namespaceCode);
        List<Resource> moduleDictionaryLocations = moduleDictionaryFiles.get(namespaceCode);
        if ( LOG.isDebugEnabled() ) {
            LOG.debug("DD Locations in Module: " + moduleDictionaryLocations);
        }

        if (moduleDictionaryLocations == null) {
           continue;
        }

        XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(beans);

        Resource configFileLocationsArray[] = new Resource[moduleDictionaryLocations.size()];
        configFileLocationsArray = moduleDictionaryLocations.toArray(configFileLocationsArray);

        try {
            xmlReader.loadBeanDefinitions(configFileLocationsArray);

            // get updated bean names from factory and compare to our previous list to get those that
            // were added by the last namespace
            List<String> addedBeanNames = Arrays.asList(beans.getBeanDefinitionNames());
            addedBeanNames = ListUtils.removeAll(addedBeanNames, allBeanNames);
            index.addBeanNamesToNamespace(namespaceCode, addedBeanNames);

            allBeanNames.addAll(addedBeanNames);
        } catch (Exception e) {
            throw new DataDictionaryException("Error loading bean definitions: " + e.getLocalizedMessage(),e);
        }
    }

    LOG.info("Completed DD XML File Load");
    timer.stop();
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:49,代碼來源:DataDictionary.java

示例6: loadDictionaryBeans

import org.apache.commons.collections.ListUtils; //導入方法依賴的package包/類
/**
 * Populates and processes the dictionary bean factory based on the configured files
 *
 * @param beans - The bean factory for the dictionary bean
 * @param moduleDictionaryFiles - List of bean xml files
 * @param index - Index of the data dictionary beans
 * @param validationFiles - The List of bean xml files loaded into the bean file
 */
public void loadDictionaryBeans(DefaultListableBeanFactory beans,
        Map<String, List<String>> moduleDictionaryFiles, DataDictionaryIndex index,
        ArrayList<String> validationFiles) {
    // expand configuration locations into files
    timer.start("XML File Loading");
    LOG.info("Starting DD XML File Load");

    List<String> allBeanNames = new ArrayList<String>();
    for (String namespaceCode : moduleLoadOrder) {
        LOG.info( "Processing Module: " + namespaceCode);
        List<String> moduleDictionaryLocations = moduleDictionaryFiles.get(namespaceCode);
        if ( LOG.isDebugEnabled() ) {
            LOG.debug("DD Locations in Module: " + moduleDictionaryLocations);
        }

        if (moduleDictionaryLocations == null) {
           continue;
        }

        XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(beans);

        String configFileLocationsArray[] = new String[moduleDictionaryLocations.size()];
        configFileLocationsArray = moduleDictionaryLocations.toArray(configFileLocationsArray);
        for (int i = 0; i < configFileLocationsArray.length; i++) {
            validationFiles.add(configFileLocationsArray[i]);
        }

        try {
            xmlReader.loadBeanDefinitions(configFileLocationsArray);

            // get updated bean names from factory and compare to our previous list to get those that
            // were added by the last namespace
            List<String> addedBeanNames = Arrays.asList(beans.getBeanDefinitionNames());
            addedBeanNames = ListUtils.removeAll(addedBeanNames, allBeanNames);
            index.addBeanNamesToNamespace(namespaceCode, addedBeanNames);

            allBeanNames.addAll(addedBeanNames);
        } catch (Exception e) {
            throw new DataDictionaryException("Error loading bean definitions: " + e.getLocalizedMessage(),e);
        }
    }

    LOG.info("Completed DD XML File Load");
    timer.stop();
}
 
開發者ID:kuali,項目名稱:rice,代碼行數:54,代碼來源:DataDictionary.java


注:本文中的org.apache.commons.collections.ListUtils.removeAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。