- All Implemented Interfaces:
IuComponentVersion,Comparable<IuComponentVersion>
IuComponentVersion.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ComponentVersionSpecification 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 TypeMethodDescriptionbooleaninthashCode()Note that when usingIuComponentVersionin aSetor as a key in aHashMaporHashtablethat 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 acomponentor dependency.intmajor()Gets the major version number as defined by Semantic Versioning.intminor()Gets the minor version number as defined by Semantic Versioning.name()Gets the component name.(package private) static ComponentVersionDetermines 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, waitMethods 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:IuComponentVersionGets 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'sversion.- Specified by:
namein interfaceIuComponentVersion- Returns:
- name
-
implementationVersion
Description copied from interface:IuComponentVersionGets the implementation version of acomponentor dependency.Must return a value for which
IuComponentVersion.SEMANTIC_VERSION_PATTERN.matcher(implementationVersion()).matches()returnstrue, ornull.- Specified by:
implementationVersionin interfaceIuComponentVersion- Returns:
- Full Semantic
implementation version of the
component.
May benullwhen referring to a dependency on the component's specification version.
Muststart withmajor() + '.' + minor() + '.'whennon-null.
-
major
public int major()Description copied from interface:IuComponentVersionGets the major version number as defined by Semantic Versioning.- Specified by:
majorin 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:IuComponentVersionGets the minor version number as defined by Semantic Versioning.- Specified by:
minorin interfaceIuComponentVersion- Returns:
- Minor version; must be non-negative
-
specificationVersion
Description copied from interface:IuComponentVersionGets 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:
specificationVersionin 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,
thisis returned. - See Also:
-
hashCode
public int hashCode()Description copied from interface:IuComponentVersionNote that when using
IuComponentVersionin aSetor as a key in aHashMaporHashtablethat is important to be aware whether of whether or not the members and/or keys are expected to represent aspecification version.- Specified by:
hashCodein interfaceIuComponentVersion- Overrides:
hashCodein classObject
-
equals
Description copied from interface:IuComponentVersionTwo implementation versions are
equalif bothnameandimplementation versionare equal. Two specification versions areequalifIuComponentVersion.name(),IuComponentVersion.major(), andIuComponentVersion.minor()are equal.An implementation version is never
equalto a specification version.Note that versions are case-sensitive.
- Specified by:
equalsin interfaceIuComponentVersion- Overrides:
equalsin classObject
-
toString
-