Class ByteArrayClassLoader.PackageLookupStrategy.ForJava9CapableVm

    • Field Detail

      • getDefinedPackage

        private final java.lang.reflect.Method getDefinedPackage
        The java.lang.ClassLoader#getDefinedPackage(String) method.
    • Constructor Detail

      • ForJava9CapableVm

        protected ForJava9CapableVm​(java.lang.reflect.Method getDefinedPackage)
        Creates a new package lookup strategy for a modern VM.
        Parameters:
        getDefinedPackage - The java.lang.ClassLoader#getDefinedPackage(String) method.
    • Method Detail

      • apply

        public java.lang.Package apply​(ByteArrayClassLoader classLoader,
                                       java.lang.String name)
        Returns a package for a given byte array class loader and a name.
        Specified by:
        apply in interface ByteArrayClassLoader.PackageLookupStrategy
        Parameters:
        classLoader - The class loader to locate a package for.
        name - The name of the package.
        Returns:
        A suitable package or null if no such package exists.