org.glassfish.jersey.message.internal
Class AbstractJaxbElementProvider
java.lang.Object
org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<T>
org.glassfish.jersey.message.internal.AbstractJaxbProvider<JAXBElement<?>>
org.glassfish.jersey.message.internal.AbstractJaxbElementProvider
- All Implemented Interfaces:
- javax.ws.rs.ext.MessageBodyReader<JAXBElement<?>>, javax.ws.rs.ext.MessageBodyWriter<JAXBElement<?>>
- Direct Known Subclasses:
- XmlJaxbElementProvider
public abstract class AbstractJaxbElementProvider
- extends AbstractJaxbProvider<JAXBElement<?>>
An abstract provider for JAXBElement.
Implementing classes may extend this class to provide specific marshalling
and unmarshalling behaviour.
When unmarshalling a UnmarshalException will result in a
WebApplicationException being thrown with a status of 400
(Client error), and a JAXBException will result in a
WebApplicationException being thrown with a status of 500
(Internal Server error).
When marshalling a JAXBException will result in a
WebApplicationException being thrown with a status of 500
(Internal Server error).
- Author:
- Paul Sandoz, Marek Potociar (marek.potociar at oracle.com)
|
Method Summary |
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
|
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
|
protected abstract JAXBElement<?> |
readFrom(Class<?> type,
javax.ws.rs.core.MediaType mediaType,
Unmarshaller u,
InputStream entityStream)
|
JAXBElement<?> |
readFrom(Class<JAXBElement<?>> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
InputStream inputStream)
|
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 entityStream)
|
protected abstract void |
writeTo(JAXBElement<?> t,
javax.ws.rs.core.MediaType mediaType,
Charset c,
Marshaller m,
OutputStream entityStream)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractJaxbElementProvider
public AbstractJaxbElementProvider(javax.ws.rs.ext.Providers ps)
AbstractJaxbElementProvider
public AbstractJaxbElementProvider(javax.ws.rs.ext.Providers ps,
javax.ws.rs.core.MediaType mt)
isReadable
public boolean isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
isWriteable
public boolean isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
readFrom
public final JAXBElement<?> readFrom(Class<JAXBElement<?>> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
InputStream inputStream)
throws IOException
- Throws:
IOException
readFrom
protected abstract JAXBElement<?> readFrom(Class<?> type,
javax.ws.rs.core.MediaType mediaType,
Unmarshaller u,
InputStream entityStream)
throws JAXBException
- Throws:
JAXBException
writeTo
public final 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 entityStream)
throws IOException
- Throws:
IOException
writeTo
protected abstract void writeTo(JAXBElement<?> t,
javax.ws.rs.core.MediaType mediaType,
Charset c,
Marshaller m,
OutputStream entityStream)
throws JAXBException
- Throws:
JAXBException
Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.