Package com.sun.xml.ws.developer
Interface JAXBContextFactory
-
public interface JAXBContextFactory
Factory to createJAXBContext
.JAX-WS uses JAXB to perform databinding when you use the service endpoint interface, and normally the JAX-WS RI drives JAXB and creates a necessary
JAXBContext
automatically.This annotation is a JAX-WS RI vendor-specific feature, which lets applications create
JAXBRIContext
(which is the JAXB RI'sJAXBContext
implementation.) Combined with the JAXB RI vendor extensions defined inJAXBRIContext
, appliation can use this to fine-tune how the databinding happens, such as by adding more classes to the binding context, by controlling the namespace mappings, and so on.Applications should either use
UsesJAXBContextFeature
orUsesJAXBContext
to instruct the JAX-WS runtime to use a custom factory.- Since:
- 2.1.5
- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description static JAXBContextFactory
DEFAULT
The default implementation that createsJAXBRIContext
according to the standard behavior.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.glassfish.jaxb.runtime.api.JAXBRIContext
createJAXBContext(SEIModel sei, List<Class> classesToBind, List<org.glassfish.jaxb.runtime.api.TypeReference> typeReferences)
Called by the JAX-WS runtime to create aJAXBRIContext
for the given SEI.
-
-
-
Field Detail
-
DEFAULT
static final JAXBContextFactory DEFAULT
The default implementation that createsJAXBRIContext
according to the standard behavior.
-
-
Method Detail
-
createJAXBContext
@NotNull org.glassfish.jaxb.runtime.api.JAXBRIContext createJAXBContext(@NotNull SEIModel sei, @NotNull List<Class> classesToBind, @NotNull List<org.glassfish.jaxb.runtime.api.TypeReference> typeReferences) throws jakarta.xml.bind.JAXBException
Called by the JAX-WS runtime to create aJAXBRIContext
for the given SEI.- Parameters:
sei
- TheSEIModel
object being constructed. This object provides you access to what SEI is being processed, and therefore useful if you are writing a genericJAXBContextFactory
that can work with arbitrary SEI classes.classesToBind
- List of classes that needs to be bound by JAXB. This value is computed according to the JAX-WS spec and given to you. The calling JAX-WS runtime expects the returnedJAXBRIContext
to be capable of handling all these classes, but you can add more (which is more common), or remove some (if you know what you are doing.) The callee is free to mutate this list.typeReferences
- List ofTypeReference
s, which is also a part of the input to the JAXB RI to control how the databinding happens. Most likely this will be just a pass-through to theJAXBRIContext.newInstance(java.lang.Class[], java.util.Collection<org.glassfish.jaxb.runtime.api.TypeReference>, java.util.Map<java.lang.Class, java.lang.Class>, java.lang.String, boolean, org.glassfish.jaxb.runtime.v2.model.annotation.RuntimeAnnotationReader)
method.- Returns:
- A non-null valid
JAXBRIContext
object. - Throws:
jakarta.xml.bind.JAXBException
- If the callee encounters a fatal problem and wants to abort the JAX-WS runtime processing of the given SEI, throw aJAXBException
. This will cause the port instantiation to fail (if on client), or the application deployment to fail (if on server.)
-
-