@Produces(value={"application/xml","application/*+xml","text/xml"}) @Consumes(value={"application/xml","application/*+xml","text/xml"}) @Provider public class XMLBeansElementProvider extends AbstractConfigurableProvider implements javax.ws.rs.ext.MessageBodyReader<org.apache.xmlbeans.XmlObject>, javax.ws.rs.ext.MessageBodyWriter<org.apache.xmlbeans.XmlObject>
BUNDLE, LOG
Constructor and Description |
---|
XMLBeansElementProvider() |
Modifier and Type | Method and Description |
---|---|
long |
getSize(org.apache.xmlbeans.XmlObject t,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mt) |
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mt) |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mt) |
protected boolean |
isXmlBean(Class<?> type)
Check if a
Class is a valid XMLBeans data object. |
protected org.apache.xmlbeans.XmlObject |
parseXmlBean(Class<?> type,
InputStream inStream)
Create an XMLBean data object from an
InputStream |
protected org.apache.xmlbeans.XmlObject |
parseXmlBean(Class<?> type,
Reader reader)
Create an XMLBean data object using a stream
Reader |
protected org.apache.xmlbeans.XmlObject |
parseXmlBean(Class<?> type,
XMLStreamReader reader)
Create an XMLBean object from an XML stream.
|
org.apache.xmlbeans.XmlObject |
readFrom(Class<org.apache.xmlbeans.XmlObject> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType m,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
InputStream is) |
void |
writeTo(org.apache.xmlbeans.XmlObject t,
Class<?> cls,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType m,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
OutputStream entityStream) |
getBus, getConsumeMediaTypes, getEnableBuffering, getEnableStreaming, getProduceMediaTypes, init, isPayloadEmpty, isPayloadEmpty, reportEmptyContentLength, setBus, setConsumeMediaTypes, setEnableBuffering, setEnableStreaming, setProduceMediaTypes
public org.apache.xmlbeans.XmlObject readFrom(Class<org.apache.xmlbeans.XmlObject> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType m, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is) throws IOException
readFrom
in interface javax.ws.rs.ext.MessageBodyReader<org.apache.xmlbeans.XmlObject>
IOException
public void writeTo(org.apache.xmlbeans.XmlObject t, Class<?> cls, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType m, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream entityStream) throws IOException
writeTo
in interface javax.ws.rs.ext.MessageBodyWriter<org.apache.xmlbeans.XmlObject>
IOException
public long getSize(org.apache.xmlbeans.XmlObject t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
getSize
in interface javax.ws.rs.ext.MessageBodyWriter<org.apache.xmlbeans.XmlObject>
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
isReadable
in interface javax.ws.rs.ext.MessageBodyReader<org.apache.xmlbeans.XmlObject>
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<org.apache.xmlbeans.XmlObject>
protected org.apache.xmlbeans.XmlObject parseXmlBean(Class<?> type, XMLStreamReader reader)
type
- declared type of the target objectreader
- stream reader for the XML streamprotected org.apache.xmlbeans.XmlObject parseXmlBean(Class<?> type, InputStream inStream)
InputStream
type
- declared type of the required objectinStream
- protected org.apache.xmlbeans.XmlObject parseXmlBean(Class<?> type, Reader reader)
Reader
type
- declared type of the desired XMLBean data objectreader
- protected boolean isXmlBean(Class<?> type)
Class
is a valid XMLBeans data object. The check procedure involves looking
for the Interface XmlObject
in the target type's declaration. Assumed to be sufficient
to identify the type as an XMLBean. From the javadoc (2.3.0) for XmlObject: "Corresponds to the XML
Schema xs:anyType, the base type for all XML Beans."type
- Apache CXF