public interface JAXBContextFactory
Factory that creates new JAXBContext
instances.
JAXBContextFactory can be located using ServiceLoader.load(Class)
Modifier and Type | Method and Description |
---|---|
JAXBContext |
createContext(java.lang.Class<?>[] classesToBeBound,
java.util.Map<java.lang.String,?> properties)
Create a new instance of a
JAXBContext class. |
JAXBContext |
createContext(java.lang.String contextPath,
java.lang.ClassLoader classLoader,
java.util.Map<java.lang.String,?> properties)
Create a new instance of a
JAXBContext class. |
JAXBContext createContext(java.lang.Class<?>[] classesToBeBound, java.util.Map<java.lang.String,?> properties) throws JAXBException
Create a new instance of a JAXBContext
class.
For semantics see JAXBContext.newInstance(Class[], java.util.Map)
classesToBeBound
- List of java classes to be recognized by the new JAXBContext
.
Classes in classesToBeBound
that are in named modules must be in a package
that is open
to at least the jakarta.xml.bind
module.
Can be empty, in which case a JAXBContext
that only knows about
spec-defined classes will be returned.properties
- provider-specific properties. Can be null, which means the same thing as passing
in an empty map.JAXBContext
.JAXBException
- if an error was encountered while creating the
JAXBContext
, such as (but not limited to):
classesToBeBound
are not open to jakarta.xml.bind
module
java.lang.IllegalArgumentException
- if the parameter contains null
(i.e., newInstance(null,someMap);
)JAXBContext createContext(java.lang.String contextPath, java.lang.ClassLoader classLoader, java.util.Map<java.lang.String,?> properties) throws JAXBException
Create a new instance of a JAXBContext
class.
For semantics see JAXBContext.newInstance(String, ClassLoader, java.util.Map)
The interpretation of properties is up to implementations. Implementations must
throw JAXBException
if it finds properties that it doesn't understand.
contextPath
- List of java package names that contain schema derived classes.
Classes in classesToBeBound
that are in named modules must be in a package
that is open
to at least the jakarta.xml.bind
module.classLoader
- This class loader will be used to locate the implementation classes.properties
- provider-specific properties. Can be null, which means the same thing as passing
in an empty map.JAXBContext
JAXBException
- if an error was encountered while creating the
JAXBContext
such as
jakarta.xml.bind
module