java.lang.Object
javax.xml.bind.ModuleUtil
Intended to be overridden on JDK9, with JEP 238 multi-release class copy.
Contains only stubs for methods needed on JDK9 runtime.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
When JAXB is in J2SE, rt.jar has to have a JAXB implementation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
delegateAddOpensToImplModule
(Class[] classes, Class<?> factorySPI) Implementation may be defined in other module thanjava.xml.bind
.(package private) static Class
findFirstByJaxbIndex
(String pkg, ClassLoader classLoader) Find first class in package byjaxb.index
file.(package private) static Class[]
getClassesFromContextPath
(String contextPath, ClassLoader classLoader) Resolves classes from context path.
-
Field Details
-
DEFAULT_FACTORY_CLASS
When JAXB is in J2SE, rt.jar has to have a JAXB implementation. However, rt.jar cannot have META-INF/services/javax.xml.bind.JAXBContext because if it has, it will take precedence over any file that applications have in their jar files.When the user bundles his own JAXB implementation, we'd like to use it, and we want the platform default to be used only when there's no other JAXB provider.
For this reason, we have to hard-code the class name into the API.
-
-
Constructor Details
-
ModuleUtil
ModuleUtil()
-
-
Method Details
-
getClassesFromContextPath
static Class[] getClassesFromContextPath(String contextPath, ClassLoader classLoader) throws JAXBException Resolves classes from context path. Only one class per package is needed to access itsModule
- Throws:
JAXBException
-
findFirstByJaxbIndex
static Class findFirstByJaxbIndex(String pkg, ClassLoader classLoader) throws IOException, JAXBException Find first class in package byjaxb.index
file.- Throws:
IOException
JAXBException
-
delegateAddOpensToImplModule
Implementation may be defined in other module thanjava.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 resolveModule
of the implementation.
-