Skip to content

Commit dd7edc6

Browse files
authored
Merge pull request quarkusio#47616 from joseiedo/main
Add Javadoc for AppModelProviderBuildItem class
2 parents 2c69fe4 + 7297fd9 commit dd7edc6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

core/deployment/src/main/java/io/quarkus/deployment/builditem/AppModelProviderBuildItem.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
import io.quarkus.builder.item.SimpleBuildItem;
1212
import io.quarkus.deployment.BootstrapConfig;
1313

14+
/**
15+
* A build item used to provide a application dependency model.
16+
*
17+
* @see ApplicationModel
18+
*/
1419
public final class AppModelProviderBuildItem extends SimpleBuildItem {
1520

1621
private static final Logger log = Logger.getLogger(AppModelProviderBuildItem.class);
1722

1823
private final ApplicationModel appModel;
24+
1925
private final Supplier<DependencyInfoProvider> depInfoProvider;
2026

2127
public AppModelProviderBuildItem(ApplicationModel appModel) {
@@ -27,6 +33,20 @@ public AppModelProviderBuildItem(ApplicationModel appModel, Supplier<DependencyI
2733
this.depInfoProvider = depInfoProvider;
2834
}
2935

36+
/**
37+
* Validates the platform imports in the application model against the provided bootstrap configuration.
38+
* The behavior in case of misalignment depends on the provided {@link BootstrapConfig#misalignedPlatformImports()}:
39+
* <ul>
40+
* <li><b>ERROR</b>: Throws a {@link RuntimeException}.</li>
41+
* <li><b>WARN</b>: Logs a warning.</li>
42+
* <li><b>IGNORE</b>: Skips validation entirely.</li>
43+
* </ul>
44+
*
45+
* @param config the bootstrap configuration
46+
* @return the validated application model
47+
* @throws RuntimeException if platform imports are misaligned and the configuration is set to {@code ERROR}
48+
* or if the configuration is unrecognized.
49+
*/
3050
public ApplicationModel validateAndGet(BootstrapConfig config) {
3151
final PlatformImports platforms = appModel.getPlatforms();
3252
if (platforms != null && !BootstrapConfig.MisalignedPlatformImports.IGNORE.equals(config.misalignedPlatformImports())

0 commit comments

Comments
 (0)