Package io.spring.initializr.metadata
Class Dependency
java.lang.Object
io.spring.initializr.metadata.MetadataElement
io.spring.initializr.metadata.Dependency
- All Implemented Interfaces:
Describable
Meta-data for a dependency. Each dependency has a primary identifier and an arbitrary
number of
aliases.- Author:
- Stephane Nicoll
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMap several attribute of the dependency for a given compatibility range. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Dependencystatic Dependencystatic DependencycreateSpringBootStarter(String name, String scope) Generate an id using the groupId and artifactId.getBom()Return the classifier, can benullto indicate that no classifier is available.Returns the item description.getLinks()Return the dependency mapping if an attribute of the dependency differs according to the Spring Boot version.getRange()getScope()getType()Return the type, can benullto indicate that the default type should be used (i.e.Return the default version, can benullto indicate that the version is managed by the project and does not need to be specified.intbooleanbooleanSpecify if this dependency is available for the specified Spring Boot version.voidresolve()Validate the dependency and complete its state based on the available information.Resolve this instance according to the specified Spring BootVersion.voidsetAliases(List<String> aliases) voidsetArtifactId(String artifactId) voidvoidsetClassifier(String classifier) voidsetCompatibilityRange(String compatibilityRange) voidsetDescription(String description) voidvoidsetGroupId(String groupId) voidsetKeywords(List<String> keywords) voidvoidsetMappings(List<Dependency.Mapping> mappings) voidsetRange(VersionRange range) voidsetRepository(String repository) voidvoidsetStarter(boolean starter) voidvoidsetVersion(String version) voidsetVersionRequirement(String versionRequirement) voidsetWeight(int weight) toString()voidupdateCompatibilityRange(VersionParser versionParser) static Dependencystatic Dependencystatic Dependencystatic Dependencystatic DependencyMethods inherited from class io.spring.initializr.metadata.MetadataElement
getId, getName, setId, setName
-
Field Details
-
SCOPE_COMPILE
Compile Scope.- See Also:
-
SCOPE_COMPILE_ONLY
Compile Only Scope.- See Also:
-
SCOPE_ANNOTATION_PROCESSOR
Annotation Processor Scope.- See Also:
-
SCOPE_RUNTIME
Runtime Scope.- See Also:
-
SCOPE_PROVIDED
Provided Scope.- See Also:
-
SCOPE_TEST
Test Scope.- See Also:
-
SCOPE_ALL
All scope types.
-
-
Constructor Details
-
Dependency
public Dependency() -
Dependency
-
-
Method Details
-
setScope
-
setCompatibilityRange
-
resolve
public void resolve()Validate the dependency and complete its state based on the available information. -
updateCompatibilityRange
-
resolve
Resolve this instance according to the specified Spring BootVersion. Return aDependencyinstance that has its state resolved against the specified version.- Parameters:
bootVersion- the Spring Boot version- Returns:
- this instance
-
match
Specify if this dependency is available for the specified Spring Boot version.- Parameters:
version- the version the check- Returns:
- of the version matches
-
generateId
Generate an id using the groupId and artifactId.- Returns:
- the generated ID
-
getAliases
-
setAliases
-
getFacets
-
setFacets
-
getGroupId
-
setGroupId
-
getArtifactId
-
setArtifactId
-
getVersion
Return the default version, can benullto indicate that the version is managed by the project and does not need to be specified.- Returns:
- the default version or
null
-
setVersion
-
getClassifier
Return the classifier, can benullto indicate that no classifier is available.- Returns:
- the classifier or
null
-
setClassifier
-
getType
Return the type, can benullto indicate that the default type should be used (i.e.jar).- Returns:
- the type or
null
-
setType
-
getMappings
Return the dependency mapping if an attribute of the dependency differs according to the Spring Boot version. If no mapping matches, default attributes are used.- Returns:
- the dependency mappings
-
setMappings
-
getDescription
Description copied from interface:DescribableReturns the item description.- Specified by:
getDescriptionin interfaceDescribable- Returns:
- the description
-
setDescription
-
getVersionRequirement
-
setVersionRequirement
-
getRange
-
setRange
-
getBom
-
setBom
-
getRepository
-
setRepository
-
getWeight
public int getWeight() -
setWeight
public void setWeight(int weight) -
isStarter
public boolean isStarter() -
setStarter
public void setStarter(boolean starter) -
getKeywords
-
setKeywords
-
getLinks
-
setLinks
-
getScope
-
getCompatibilityRange
-
toString
-
create
-
createSpringBootStarter
-
createSpringBootStarter
-
withId
-
withId
-
withId
-
withId
-
withId
-