Skip to content

Commit 5a699c5

Browse files
chore: merge main into release [skip ci]
2 parents effe60b + fc87971 commit 5a699c5

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

microsphere-spring-boot-core/src/main/java/io/microsphere/spring/boot/autoconfigure/ConfigurableAutoConfigurationImportFilter.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,21 @@ public Object getProperty(String name) {
211211
return null;
212212
}
213213

214+
/**
215+
* Adds the given auto-configuration class names to the exclusion set.
216+
*
217+
* <h3>Example Usage</h3>
218+
* <pre>{@code
219+
* ExcludedAutoConfigurationClassPropertySource source =
220+
* ExcludedAutoConfigurationClassPropertySource.get(environment);
221+
* source.addClasses(Arrays.asList(
222+
* "com.example.FooAutoConfiguration",
223+
* "com.example.BarAutoConfiguration"
224+
* ));
225+
* }</pre>
226+
*
227+
* @param classNames the auto-configuration class names to exclude
228+
*/
214229
public void addClasses(Iterable<String> classNames) {
215230
Set<String> allClassNames = this.source;
216231
classNames.forEach(allClassNames::add);
@@ -227,6 +242,19 @@ static ExcludedAutoConfigurationClassPropertySource get(Environment environment)
227242
}
228243
}
229244

245+
/**
246+
* Checks whether the given auto-configuration class name is in the exclusion set.
247+
*
248+
* <h3>Example Usage</h3>
249+
* <pre>{@code
250+
* ConfigurableAutoConfigurationImportFilter filter = new ConfigurableAutoConfigurationImportFilter();
251+
* filter.setEnvironment(environment);
252+
* boolean excluded = filter.isExcluded("com.example.FooAutoConfiguration");
253+
* }</pre>
254+
*
255+
* @param autoConfigurationClassName the fully qualified class name to check
256+
* @return {@code true} if the class is excluded, {@code false} otherwise
257+
*/
230258
boolean isExcluded(String autoConfigurationClassName) {
231259
return hasText(autoConfigurationClassName) && excludedAutoConfigurationClasses.contains(autoConfigurationClassName);
232260
}

0 commit comments

Comments
 (0)