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:
- MessageBodyReader<JAXBElement<?>>, 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,
MediaType mediaType)
|
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
|
protected abstract JAXBElement<?> |
readFrom(Class<?> type,
MediaType mediaType,
Unmarshaller u,
InputStream entityStream)
|
JAXBElement<?> |
readFrom(Class<JAXBElement<?>> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,String> httpHeaders,
InputStream inputStream)
|
void |
writeTo(JAXBElement<?> t,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream)
|
protected abstract void |
writeTo(JAXBElement<?> t,
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(Providers ps)
AbstractJaxbElementProvider
public AbstractJaxbElementProvider(Providers ps,
MediaType mt)
isReadable
public boolean isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
isWriteable
public boolean isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
readFrom
public final JAXBElement<?> readFrom(Class<JAXBElement<?>> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,String> httpHeaders,
InputStream inputStream)
throws IOException
- Throws:
IOException
readFrom
protected abstract JAXBElement<?> readFrom(Class<?> type,
MediaType mediaType,
Unmarshaller u,
InputStream entityStream)
throws JAXBException
- Throws:
JAXBException
writeTo
public final void writeTo(JAXBElement<?> t,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream)
throws IOException
- Throws:
IOException
writeTo
protected abstract void writeTo(JAXBElement<?> t,
MediaType mediaType,
Charset c,
Marshaller m,
OutputStream entityStream)
throws JAXBException
- Throws:
JAXBException
Copyright © 2007-2013 Oracle Corporation. All Rights Reserved. Use is subject to license terms.