本文整理匯總了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);
}
}
示例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);
}
}
示例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;
}
示例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");
}
示例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();
}
示例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();
}