- All Implemented Interfaces:
IuComponentVersion
,Comparable<IuComponentVersion>
IuComponentVersion
.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ComponentVersion
Specification version constant for detecting Jakarta Servlet version 6 or higher.Fields inherited from interface edu.iu.type.IuComponentVersion
SEMANTIC_VERSION_PATTERN
-
Constructor Summary
ConstructorsConstructorDescriptionComponentVersion
(String name, int major, int minor) Creates a specification version.ComponentVersion
(String name, String version) Creates an implementation versionComponentVersion
(String extenstionListItem, Attributes mainAttributes) Reads a dependency item from an extension list -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
Note that when usingIuComponentVersion
in aSet
or as a key in aHashMap
orHashtable
that is important to be aware whether of whether or not the members and/or keys are expected to represent aspecification version
.Gets the implementation version of acomponent
or dependency.int
major()
Gets the major version number as defined by Semantic Versioning.int
minor()
Gets the minor version number as defined by Semantic Versioning.name()
Gets the component name.(package private) static ComponentVersion
Determines the component version for a path entry: class folder orjar file
.Gets the specification version implied by this version reference.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.iu.type.IuComponentVersion
compareTo, meets
-
Field Details
-
SERVLET_6
Specification version constant for detecting Jakarta Servlet version 6 or higher.
-
-
Constructor Details
-
ComponentVersion
ComponentVersion(String name, int major, int minor) Creates a specification version.- Parameters:
name
- extension namemajor
- major version numberminor
- minor version number
-
ComponentVersion
Creates an implementation version- Parameters:
name
- extension nameversion
- implementation version
-
ComponentVersion
ComponentVersion(String extenstionListItem, Attributes mainAttributes) Reads a dependency item from an extension list- Parameters:
extenstionListItem
- extension list itemmainAttributes
-Manifest.getMainAttributes()
-
-
Method Details
-
of
Determines the component version for a path entry: class folder orjar file
.- Parameters:
pathEntry
- path entry- Returns:
- component version
- Throws:
IOException
- if an I/O error occurs discovering the component version
-
name
Description copied from interface:IuComponentVersion
Gets the component name.The component name should be universally unique, and must be unique within the
component's path
. The name is part of of thecomponent's
version.- Specified by:
name
in interfaceIuComponentVersion
- Returns:
- name
-
implementationVersion
Description copied from interface:IuComponentVersion
Gets the implementation version of acomponent
or dependency.Must return a value for which
IuComponentVersion.SEMANTIC_VERSION_PATTERN
.matcher(implementationVersion())
.matches()
returnstrue
, ornull
.- Specified by:
implementationVersion
in interfaceIuComponentVersion
- Returns:
- Full Semantic
implementation version of the
component
.
May benull
when referring to a dependency on the component's specification version.
Muststart with
major() + '.' + minor() + '.'
whennon-null
.
-
major
public int major()Description copied from interface:IuComponentVersion
Gets the major version number as defined by Semantic Versioning.- Specified by:
major
in interfaceIuComponentVersion
- Returns:
- Major version; must be non-negative,
should be positive. Non-development applications
may reject versions with a major version of
0
.
-
minor
public int minor()Description copied from interface:IuComponentVersion
Gets the minor version number as defined by Semantic Versioning.- Specified by:
minor
in interfaceIuComponentVersion
- Returns:
- Minor version; must be non-negative
-
specificationVersion
Description copied from interface:IuComponentVersion
Gets the specification version implied by this version reference.The specification version relates to the minor version of the implementation. For example, if the implementation version is
1.2.34-SNAPSHOT
, then the specification version is1.2
.- Specified by:
specificationVersion
in interfaceIuComponentVersion
- Returns:
- Specification version implied by this
version reference. For an implementation
version, the version of the implemented
specification is returned. For a specification
version,
this
is returned. - See Also:
-
hashCode
public int hashCode()Description copied from interface:IuComponentVersion
Note that when using
IuComponentVersion
in aSet
or as a key in aHashMap
orHashtable
that is important to be aware whether of whether or not the members and/or keys are expected to represent aspecification version
.- Specified by:
hashCode
in interfaceIuComponentVersion
- Overrides:
hashCode
in classObject
-
equals
Description copied from interface:IuComponentVersion
Two implementation versions are
equal
if bothname
andimplementation version
are equal. Two specification versions areequal
ifIuComponentVersion.name()
,IuComponentVersion.major()
, andIuComponentVersion.minor()
are equal.An implementation version is never
equal
to a specification version.Note that versions are case-sensitive.
- Specified by:
equals
in interfaceIuComponentVersion
- Overrides:
equals
in classObject
-
toString
-