public final class IlvPluginVersion extends Object
IlvPluginVersion
objects
are automatically instantiated when the plugin manager parses
the
plugin.xml manifest file of plugins. Versions appear in two
places in the manifest file:version
attribute of the plugin
root element specifies the version of the plug-in being described.version
attribute of the
plugin/requires/import/versionFilter
elements specifies
the version that must be matched against the version of the required
plug-in. This attribute is used in conjunction with the
type
attribute that specifies
who the specified version and the versions of the required plugins
should be compared. The type
attribute can have one of
the following values:perfect
to specify that compared versions must
equal. The use of this attribute results in the call to the
equals(java.lang.Object)
method.equivalent
to specify that compared versions must
be equivalent. See the method isEquivalentTo(ilog.views.appframe.plugin.IlvPluginVersion)
for more details.compatible
to specify that compared versions must
be compatible. See the method isCompatibleWith(ilog.views.appframe.plugin.IlvPluginVersion)
for more details.greaterOrEqual
to specify that the version of the
required plug-in must be greater or equal than the specified version.
See the method isGreaterOrEqualTo(ilog.views.appframe.plugin.IlvPluginVersion)
for more details.A version is composed of four components:
0
.0
.In a string representation, components are specified in the order Major, Minor, Service and Qualifier and are separated with a decimal point. Here are some examples of valid string version representations:
1.0.0
2.4.6.alpha-2
4.5.0.build-05062003
2.1
1
IlvPluginException
errors with the ID IlvPluginException.BAD_VERSION_ID_ERROR
.Constructor and Description |
---|
IlvPluginVersion(String version)
Constructs a plug-in version from the specified string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Determines whether this version equals the specified
object |
int |
getMajorComponent()
Returns the major component of this
version identifier.
|
int |
getMinorComponent()
Returns the minor component of this version identifier.
|
String |
getQualifierComponent()
Returns the qualifier component of this version.
|
int |
getServiceComponent()
Returns the service component of this version.
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isCompatibleWith(IlvPluginVersion id)
Compares two version identifiers for compatibility.
|
boolean |
isEquivalentTo(IlvPluginVersion id)
Compares two version identifiers for equivalency.
|
boolean |
isGreaterOrEqualTo(IlvPluginVersion version)
Determines whether this version is greater or equal than
the specified
version . |
boolean |
isGreaterThan(IlvPluginVersion id)
Compares two version identifiers for order using multi-decimal
comparison.
|
boolean |
isPerfect(IlvPluginVersion id)
Compares two version identifiers for perfect equality.
|
String |
toString()
Returns the string representation of this version identifier.
|
public IlvPluginVersion(String version) throws Exception
IlvPluginVersion
class
for more details on the format of this string.version
- The string representation of the version.Exception
- An exception is thrown if the specified
string version does not have a valid version format.public boolean equals(Object object)
object
public int hashCode()
public int getMajorComponent()
public int getMinorComponent()
public int getServiceComponent()
public String getQualifierComponent()
public boolean isGreaterOrEqualTo(IlvPluginVersion version)
version
.
A version identifier is considered to be greater than or equal if its major component is greater than the argument major component, or the major components are equal and its minor component is greater than the argument minor component, or the major and minor components are equal and its service component is greater than the argument service component, or the major, minor and service components are equal and the qualifier component is greater than the argument qualifier component (using lexicographic string comparison), or all components are equal.
version
- The version to compare this version with.true
is this version
is greater or equal than the specified version. Otherwise, this
method returns false
.public boolean isCompatibleWith(IlvPluginVersion id)
A version identifier is considered to be compatible if its major component equals to the argument major component, and its minor component is greater than or equal to the argument minor component. If the minor components are equal, than the service level of the version identifier must be greater than or equal to the service level of the argument identifier. If the service levels are equal, the two version identifiers are considered to be equivalent if this qualifier is greater or equal to the qualifier of the argument (using lexicographic string comparison).
id
- the other version identifiertrue
is this version identifier
is compatible with the given version identifier, and
false
otherwisepublic boolean isEquivalentTo(IlvPluginVersion id)
Two version identifiers are considered to be equivalent if their major and minor component equal and are at least at the same service level as the argument. If the service levels are equal, the two version identifiers are considered to be equivalent if this qualifier is greater or equal to the qualifier of the argument (using lexicographic string comparison).
id
- the other version identifiertrue
is this version identifier
is equivalent to the given version identifier, and
false
otherwisepublic boolean isPerfect(IlvPluginVersion id)
Two version identifiers are considered to be perfectly equal if their major, minor, service and qualifier components are equal
id
- the other version identifiertrue
is this version identifier
is perfectly equal to the given version identifier, and
false
otherwisepublic boolean isGreaterThan(IlvPluginVersion id)
id
- the other version identifiertrue
is this version identifier
is greater than the given version identifier, and
false
otherwise© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.