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 class
Map several attribute of the dependency for a given compatibility range. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Dependency
static Dependency
static Dependency
createSpringBootStarter
(String name, String scope) Generate an id using the groupId and artifactId.getBom()
Return the classifier, can benull
to 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 benull
to indicate that the default type should be used (i.e.Return the default version, can benull
to indicate that the version is managed by the project and does not need to be specified.int
boolean
boolean
Specify if this dependency is available for the specified Spring Boot version.void
resolve()
Validate the dependency and complete its state based on the available information.Resolve this instance according to the specified Spring BootVersion
.void
setAliases
(List<String> aliases) void
setArtifactId
(String artifactId) void
void
setClassifier
(String classifier) void
setCompatibilityRange
(String compatibilityRange) void
setDescription
(String description) void
void
setGroupId
(String groupId) void
setKeywords
(List<String> keywords) void
void
setMappings
(List<Dependency.Mapping> mappings) void
setRange
(VersionRange range) void
setRepository
(String repository) void
void
setStarter
(boolean starter) void
void
setVersion
(String version) void
setVersionRequirement
(String versionRequirement) void
setWeight
(int weight) toString()
void
updateCompatibilityRange
(VersionParser versionParser) static Dependency
static Dependency
static Dependency
static Dependency
static Dependency
Methods 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 aDependency
instance 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 benull
to 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 benull
to indicate that no classifier is available.- Returns:
- the classifier or
null
-
setClassifier
-
getType
Return the type, can benull
to 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:Describable
Returns the item description.- Specified by:
getDescription
in 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
-