@Provider @Produces(value={"application/xml","application/*+xml","text/xml","text/*+xml"}) @Consumes(value={"application/xml","application/*+xml","text/xml","text/*+xml"}) public class JAXBElementProvider extends AbstractJAXBProvider<JAXBElement<?>>
A JAXB Provider which handles parameter and return types of JAXBElement
. This provider will be
selected when the resource is declared as:
@POST
@Consumes("applictaion/xml")
@Produces("applictaion/xml")
public JAXBElement<Contact> getContact(JAXBElement<Contact> value);
providers
Constructor and Description |
---|
JAXBElementProvider() |
Modifier and Type | Method and Description |
---|---|
CompletionStage<Void> |
asyncWriteTo(JAXBElement<?> t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
AsyncOutputStream outputStream)
Write a type to an HTTP message using async IO.
|
protected boolean |
isReadWritable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
JAXBElement<?> |
readFrom(Class<JAXBElement<?>> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
InputStream entityStream) |
void |
writeTo(JAXBElement<?> t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream outputStream) |
decorateMarshaller, decorateUnmarshaller, findJAXBContext, getCharset, getMarshaller, isDisableDTDs, isDisableExternalEntities, isEnableSecureProcessingFeature, isReadable, isWriteable, needsSecurity, processWithSecureProcessing, setCharset, setDisableDTDs, setDisableExternalEntities, setEnableSecureProcessingFeature
getSize
protected boolean isReadWritable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isReadWritable
in class AbstractJAXBProvider<JAXBElement<?>>
public JAXBElement<?> readFrom(Class<JAXBElement<?>> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException
readFrom
in interface javax.ws.rs.ext.MessageBodyReader<JAXBElement<?>>
readFrom
in class AbstractJAXBProvider<JAXBElement<?>>
IOException
public void writeTo(JAXBElement<?> t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream outputStream) throws IOException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<JAXBElement<?>>
writeTo
in class AbstractJAXBProvider<JAXBElement<?>>
IOException
public CompletionStage<Void> asyncWriteTo(JAXBElement<?> t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, AsyncOutputStream outputStream)
AsyncMessageBodyWriter
t
- the instance to write.type
- the class of instance that is to be written.genericType
- the type of instance to be written. GenericEntity
provides a way to specify this information at runtime.annotations
- an array of the annotations attached to the message entity instance.mediaType
- the media type of the HTTP entity.httpHeaders
- a mutable map of the HTTP message headers.outputStream
- the AsyncOutputStream
for the HTTP entity. The
implementation should not close the output stream.CompletionStage
indicating completionCopyright © 2020 JBoss by Red Hat. All rights reserved.