Class JarVersionedRuntimes

java.lang.Object
org.apache.maven.shared.jar.classes.JarVersionedRuntimes

public class JarVersionedRuntimes extends Object
Gathered facts about the runtime versions contained within a Multi-Release JAR file.
See Also:
  • Constructor Details

  • Method Details

    • getVersionedRuntimeMap

      public NavigableMap<Integer,JarVersionedRuntime> getVersionedRuntimeMap()
      Returns:
      the versionedRuntimeMap
    • getJarVersionedRuntime

      public JarVersionedRuntime getJarVersionedRuntime(Integer version)
    • getJarClasses

      public JarClasses getJarClasses(Integer version)
      Return the JarClasses associated to the release.
      Parameters:
      version - the release version.
      Returns:
      the JarClasses.
    • getRuntimeVersionsAsSet

      public Set<Integer> getRuntimeVersionsAsSet()
      Get a set of release versions included in the JAR file.
      Returns:
      a set with the Java versions as Strings.
    • getBestFitJarVersionedRuntime

      public JarVersionedRuntime getBestFitJarVersionedRuntime(Integer version)
      Return the highest the JarClasses of the Jdk version that would be executed if they would be executed on a JVM given by the release parameter.
      Parameters:
      version - the Jdk version number of the executing JVM.
      Returns:
      The fittest JarClasses object matching if found one, or null otherwise.
      Throws:
      NullPointerException - if release is null.
    • getBestFitJarVersionedRuntimeBySystemProperty

      public JarVersionedRuntime getBestFitJarVersionedRuntimeBySystemProperty(String key)
      Return the highest the JarClasses of the Jdk version that would be executed if they would be executed given a System property. Example values: "java.version.specification" or "java.vm.specification.version".
      Parameters:
      key - the System property.
      Returns:
      The best fitting JarClasses object matching if found one, or null otherwise.
      Throws:
      NullPointerException - if key is null
      IllegalStateException - if system property value of key is null
      IllegalStateException - if system property cannot be converted to Integer