Class ModuleApiLevels
A module declares its UltiTools API level as the integer api-version in
plugin.yml. UltiTools-API 7.0 is a new baseline: a declared integer below
MIN_INSTALLABLE_API_LEVEL is refused before the module's main class loads.
Missing or non-integer declarations are refused too, including on manual loading.
/upm requires an integer declaration and installs or stages updates only from this
floor through the framework's own level. Its catalogue version requests send both bounds.
Rebuilding against 7.0 is required; changing an old module's declaration alone does not repair
bytecode that references removed APIs.
The upper bound reuses PluginManager.requiresNewerFramework(int, int), the single
definition of "the module needs a newer framework", so that comparison still exists once.
- Since:
- 6.3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Loggerstatic final intThe lowest declared moduleapi-versionloaded or installed on the 7.0 baseline. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intThis framework's own API level, asUltiTools.getPluginVersion()reads it from the bundledenv.yml(700 for 7.0.0 and its snapshots).static booleanisInstallable(int moduleLevel, int floor, int frameworkLevel) Whether/upminstalls a module declaringmoduleLevel.static booleanisLoadable(Integer moduleLevel) The minimum admission shared by manual loading, installation and staged updates.private static booleanmeetsFloor(Integer moduleLevel, int floor) static IntegerAplugin.ymlapi-versionas an integer level.
-
Field Details
-
MIN_INSTALLABLE_API_LEVEL
public static final int MIN_INSTALLABLE_API_LEVELThe lowest declared moduleapi-versionloaded or installed on the 7.0 baseline. Sent to the catalogue asminApiLeveland checked before loading a module main class and before accepting a downloaded JAR.- See Also:
-
LOGGER
-
-
Constructor Details
-
ModuleApiLevels
private ModuleApiLevels()
-
-
Method Details
-
frameworkLevel
public static int frameworkLevel()This framework's own API level, asUltiTools.getPluginVersion()reads it from the bundledenv.yml(700 for 7.0.0 and its snapshots).When that cannot be read, or reads below
MIN_INSTALLABLE_API_LEVEL-- impossible for a build that contains this class, so a misreading -- the floor is used instead and a warning is logged. The floor is a lower bound of the true level, so the fallback can only refuse a module this framework could load; it never admits one it cannot.- Returns:
- the level to send as
apiLeveland to check downloads against
-
isInstallable
public static boolean isInstallable(int moduleLevel, int floor, int frameworkLevel) Whether/upminstalls a module declaringmoduleLevel.- Parameters:
moduleLevel- the module's declaredapi-versionfloor- the lowest level installed,MIN_INSTALLABLE_API_LEVELframeworkLevel- this framework's level,frameworkLevel()- Returns:
truewhenfloor <= moduleLevel <= frameworkLevel
-
isLoadable
The minimum admission shared by manual loading, installation and staged updates. The loader keeps its existing post-instantiation upper-bound check.- Parameters:
moduleLevel- the parsed declaration, ornullwhen invalid or absent- Returns:
- whether the module declares an integer at or above the minimum
-
meetsFloor
-
parse
-