Java Code Examples for org.springframework.core.OrderComparator#INSTANCE
The following examples show how to use
org.springframework.core.OrderComparator#INSTANCE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PostProcessorRegistrationDelegate.java From spring-analysis-note with MIT License | 5 votes |
private static void sortPostProcessors(List<?> postProcessors, ConfigurableListableBeanFactory beanFactory) { Comparator<Object> comparatorToUse = null; if (beanFactory instanceof DefaultListableBeanFactory) { comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator(); } if (comparatorToUse == null) { comparatorToUse = OrderComparator.INSTANCE; } postProcessors.sort(comparatorToUse); }
Example 2
Source File: PostProcessorRegistrationDelegate.java From java-technology-stack with MIT License | 5 votes |
private static void sortPostProcessors(List<?> postProcessors, ConfigurableListableBeanFactory beanFactory) { Comparator<Object> comparatorToUse = null; if (beanFactory instanceof DefaultListableBeanFactory) { comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator(); } if (comparatorToUse == null) { comparatorToUse = OrderComparator.INSTANCE; } postProcessors.sort(comparatorToUse); }
Example 3
Source File: ApiFilenameCheckerFactory.java From swagger-brake with Apache License 2.0 | 5 votes |
/** * Creates an {@link ApiFileNameChecker} instance based on the provided configuredApiFilename argument. * @param configuredApiFilename the filename that is used to construct a proper instance f {@link ApiFileNameChecker} * @return the {@link ApiFileNameChecker} */ public ApiFileNameChecker create(String configuredApiFilename) { Collection<ApiFileNameChecker> checkers = new TreeSet<>(OrderComparator.INSTANCE); checkers.add(new SwaggerApiFileNameChecker()); if (StringUtils.isNotBlank(configuredApiFilename)) { checkers.add(new ConfigurableApiFileNameChecker(configuredApiFilename)); } return new ApiFileNameCheckerChain(checkers); }
Example 4
Source File: PostProcessorRegistrationDelegate.java From lams with GNU General Public License v2.0 | 5 votes |
private static void sortPostProcessors(List<?> postProcessors, ConfigurableListableBeanFactory beanFactory) { Comparator<Object> comparatorToUse = null; if (beanFactory instanceof DefaultListableBeanFactory) { comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator(); } if (comparatorToUse == null) { comparatorToUse = OrderComparator.INSTANCE; } Collections.sort(postProcessors, comparatorToUse); }
Example 5
Source File: PostProcessorRegistrationDelegate.java From spring4-understanding with Apache License 2.0 | 5 votes |
private static void sortPostProcessors(ConfigurableListableBeanFactory beanFactory, List<?> postProcessors) { Comparator<Object> comparatorToUse = null; if (beanFactory instanceof DefaultListableBeanFactory) { comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator(); } if (comparatorToUse == null) { comparatorToUse = OrderComparator.INSTANCE; } Collections.sort(postProcessors, comparatorToUse); }
Example 6
Source File: DefaultListableBeanFactory.java From spring-analysis-note with MIT License | 4 votes |
private Comparator<Object> adaptOrderComparator(Map<String, ?> matchingBeans) { Comparator<Object> dependencyComparator = getDependencyComparator(); OrderComparator comparator = (dependencyComparator instanceof OrderComparator ? (OrderComparator) dependencyComparator : OrderComparator.INSTANCE); return comparator.withSourceProvider(createFactoryAwareOrderSourceProvider(matchingBeans)); }
Example 7
Source File: DefaultListableBeanFactory.java From java-technology-stack with MIT License | 4 votes |
private Comparator<Object> adaptOrderComparator(Map<String, ?> matchingBeans) { Comparator<Object> dependencyComparator = getDependencyComparator(); OrderComparator comparator = (dependencyComparator instanceof OrderComparator ? (OrderComparator) dependencyComparator : OrderComparator.INSTANCE); return comparator.withSourceProvider(createFactoryAwareOrderSourceProvider(matchingBeans)); }