com.sun.jersey.core.provider.jaxb
Class AbstractJAXBElementProvider
java.lang.Object
com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider<T>
com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider<JAXBElement<?>>
com.sun.jersey.core.provider.jaxb.AbstractJAXBElementProvider
- All Implemented Interfaces:
- javax.ws.rs.ext.MessageBodyReader<JAXBElement<?>>, javax.ws.rs.ext.MessageBodyWriter<JAXBElement<?>>
- Direct Known Subclasses:
- FastInfosetJAXBElementProvider, JSONJAXBElementProvider, 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@Sun.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 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 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 entityStream)
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 © 2011 Oracle Corporation. All Rights Reserved.