Class ModuleUtil


  • class ModuleUtil
    extends java.lang.Object
    Intended to be overridden on JDK9, with JEP 238 multi-release class copy. Contains only stubs for methods needed on JDK9 runtime.
    • Constructor Summary

      Constructors 
      Constructor Description
      ModuleUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void delegateAddOpensToImplModule​(java.lang.Class[] classes, java.lang.Class<?> factorySPI)
      Implementation may be defined in other module than java.xml.bind.
      (package private) static java.lang.Class findFirstByJaxbIndex​(java.lang.String pkg, java.lang.ClassLoader classLoader)
      Find first class in package by jaxb.index file.
      (package private) static java.lang.Class[] getClassesFromContextPath​(java.lang.String contextPath, java.lang.ClassLoader classLoader)
      Resolves classes from context path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModuleUtil

        ModuleUtil()
    • Method Detail

      • getClassesFromContextPath

        static java.lang.Class[] getClassesFromContextPath​(java.lang.String contextPath,
                                                           java.lang.ClassLoader classLoader)
                                                    throws JAXBException
        Resolves classes from context path. Only one class per package is needed to access its Module
        Throws:
        JAXBException
      • findFirstByJaxbIndex

        static java.lang.Class findFirstByJaxbIndex​(java.lang.String pkg,
                                                    java.lang.ClassLoader classLoader)
                                             throws java.io.IOException,
                                                    JAXBException
        Find first class in package by jaxb.index file.
        Throws:
        java.io.IOException
        JAXBException
      • delegateAddOpensToImplModule

        static void delegateAddOpensToImplModule​(java.lang.Class[] classes,
                                                 java.lang.Class<?> factorySPI)
        Implementation may be defined in other module than java.xml.bind. In that case openness open of classes should be delegated to implementation module.
        Parameters:
        classes - used to resolve module for Module.addOpens(String, java.lang.Module)
        factorySPI - used to resolve Module of the implementation.