Class InitializrConfiguration
java.lang.Object
io.spring.initializr.metadata.InitializrConfiguration
- Direct Known Subclasses:
InitializrProperties
Various configuration options used by the service.
- Author:
- Stephane Nicoll, Chris Bono, Moritz Halbritter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefines additional environment settings.static classPlatform-specific settings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncleanPackageName(@Nullable String packageName, @Nullable Language language, String defaultPackageName) Clean the specified package name if necessary.generateApplicationName(@Nullable String name) Generate a suitable application name based on the specified name.getEnv()booleanisValidApplicationName(String name) Checks whether the given name is a valid application name.voidmerge(InitializrConfiguration other) Merge the given configuration into this one.voidvalidate()Validate this configuration.
-
Constructor Details
-
InitializrConfiguration
public InitializrConfiguration()
-
-
Method Details
-
getEnv
-
validate
public void validate()Validate this configuration.- Throws:
InvalidInitializrMetadataException- if the configuration is invalid
-
merge
Merge the given configuration into this one.- Parameters:
other- the configuration to merge
-
generateApplicationName
Generate a suitable application name based on the specified name. If no suitable application name can be generated from the specifiedname, theInitializrConfiguration.Env.getFallbackApplicationName()is used instead.No suitable application name can be generated if the name is
nullor if it contains an invalid character for a class identifier.- Parameters:
name- the the source name- Returns:
- the generated application name
- See Also:
-
isValidApplicationName
Checks whether the given name is a valid application name.- Parameters:
name- the name to check- Returns:
- whether the name is a valid application name
-
cleanPackageName
public String cleanPackageName(@Nullable String packageName, @Nullable Language language, String defaultPackageName) Clean the specified package name if necessary. If the package name cannot be transformed to a valid package name, thedefaultPackageNameis used instead.The package name cannot be cleaned if the specified
packageNameisnullor if it contains an invalid character for a class identifier.- Parameters:
packageName- the package namelanguage- the project languagedefaultPackageName- the default package name- Returns:
- the cleaned package name
- See Also:
-