determineProjectType() — spring-boot Function Reference
Architecture documentation for the determineProjectType() function in ProjectGenerationRequest.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD fa48957e_1448_1675_9645_a9f7ad81fc16["determineProjectType()"] 1d2edafd_169c_c817_ef96_8ee124d9006e["generateUrl()"] 1d2edafd_169c_c817_ef96_8ee124d9006e -->|calls| fa48957e_1448_1675_9645_a9f7ad81fc16 cc753546_b960_f82c_0b3f_6a84f64719e5["isDetectType()"] fa48957e_1448_1675_9645_a9f7ad81fc16 -->|calls| cc753546_b960_f82c_0b3f_6a84f64719e5 e340557d_9fff_085d_218a_1244323dcdfa["filter()"] fa48957e_1448_1675_9645_a9f7ad81fc16 -->|calls| e340557d_9fff_085d_218a_1244323dcdfa style fa48957e_1448_1675_9645_a9f7ad81fc16 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java lines 364–401
protected ProjectType determineProjectType(InitializrServiceMetadata metadata) {
if (this.type != null) {
ProjectType result = metadata.getProjectTypes().get(this.type);
if (result == null) {
throw new ReportableException(
("No project type with id '" + this.type + "' - check the service capabilities (--list)"));
}
return result;
}
else if (isDetectType()) {
Map<String, ProjectType> types = new HashMap<>(metadata.getProjectTypes());
if (this.build != null) {
filter(types, "build", this.build);
}
if (this.format != null) {
filter(types, "format", this.format);
}
if (types.size() == 1) {
return types.values().iterator().next();
}
else if (types.isEmpty()) {
throw new ReportableException("No type found with build '" + this.build + "' and format '" + this.format
+ "' check the service capabilities (--list)");
}
else {
throw new ReportableException("Multiple types found with build '" + this.build + "' and format '"
+ this.format + "' use --type with a more specific value " + types.keySet());
}
}
else {
ProjectType defaultType = metadata.getDefaultType();
if (defaultType == null) {
throw new ReportableException(("No project type is set and no default is defined. "
+ "Check the service capabilities (--list)"));
}
return defaultType;
}
}
Domain
Subdomains
Calls
- filter()
- isDetectType()
Called By
Source
Frequently Asked Questions
What does determineProjectType() do?
determineProjectType() is a function in the spring-boot codebase.
What does determineProjectType() call?
determineProjectType() calls 2 function(s): filter, isDetectType.
What calls determineProjectType()?
determineProjectType() is called by 1 function(s): generateUrl.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free