@Provider
@Consumes(value={"application/xml","application/*+xml","text/xml","text/*+xml"})
@Produces(value={"application/xml","application/*+xml","text/xml","text/*+xml"})
public class JAXBContextResolver
extends Object
implements javax.ws.rs.ext.ContextResolver<JAXBContextResolver>
JAXBContext.| Constructor and Description |
|---|
JAXBContextResolver() |
| Modifier and Type | Method and Description |
|---|---|
void |
addJAXBContext(JAXBContext jaxbContext,
Class<?> clazz)
Add prepared JAXBContext that will be mapped to set of class.
|
JAXBContext |
createJAXBContext(Class<?> clazz)
Create and add in cache JAXBContext for supplied set of classes.
|
JAXBContextResolver |
getContext(Class<?> type) |
JAXBContext |
getJAXBContext(Class<?> clazz)
Return JAXBContext according to supplied type.
|
public JAXBContextResolver getContext(Class<?> type)
getContext in interface javax.ws.rs.ext.ContextResolver<JAXBContextResolver>public JAXBContext getJAXBContext(Class<?> clazz) throws JAXBException
clazz - class to be boundJAXBException - if JAXBContext creation failedpublic JAXBContext createJAXBContext(Class<?> clazz) throws JAXBException
clazz - java class to be boundJAXBException - if JAXBContext for supplied classes can't be created in any reasonspublic void addJAXBContext(JAXBContext jaxbContext, Class<?> clazz)
jaxbContext - JAXBContextclazz - java classes to be boundCopyright © 2012–2016 Codenvy, S.A.. All rights reserved.