Class ClassFileLocator.MultiReleaseAware

    • Field Detail

      • MULTI_RELEASE_ATTRIBUTE

        private static final java.lang.String MULTI_RELEASE_ATTRIBUTE
        The property name of a multi-release JAR file.
        See Also:
        Constant Field Values
      • NO_MULTI_RELEASE

        protected static final int[] NO_MULTI_RELEASE
        Indicates that no multi-release versions exist.
      • version

        private final int[] version
        Contains the existing multi-release jar folders that are available for the current JVM version in decreasing order.
    • Constructor Detail

      • MultiReleaseAware

        protected MultiReleaseAware​(int[] version)
        Creates a multi-release aware class file locator.
        Parameters:
        version - Contains the existing multi-release jar folders that are available for the current JVM version in decreasing order.
    • Method Detail

      • locate

        public ClassFileLocator.Resolution locate​(java.lang.String name)
                                           throws java.io.IOException
        Locates the class file for a given type and returns the binary data of the class file.
        Specified by:
        locate in interface ClassFileLocator
        Parameters:
        name - The name of the type to locate a class file representation for.
        Returns:
        Any binary representation of the type which might be illegal.
        Throws:
        java.io.IOException - If reading a class file causes an error.
      • doLocate

        @MaybeNull
        protected abstract byte[] doLocate​(java.lang.String path)
                                    throws java.io.IOException
        Resolves a possible multi-release entry, if it exists.
        Parameters:
        path - The path of the class file.
        Returns:
        The class file's binary representation or null if it does not exist.
        Throws:
        java.io.IOException - If an I/O exception occurs.