@Produces(value={"application/xml","application/*+xml","text/xml"})
@Consumes(value={"application/xml","application/*+xml","text/xml"})
@Provider
public class JAXBElementProvider<T>
extends AbstractJAXBProvider<T>
AbstractJAXBProvider.CollectionWrapper, AbstractJAXBProvider.JAXBCollectionWrapperReaderclassContexts, collectionContextClasses, inAppendMap, inDropElements, inElementsMap, jaxbElementClassMap, marshalAsJaxbElement, NS_MAPPER_PROPERTY_RI, NS_MAPPER_PROPERTY_RI_INT, outAppendMap, outDropElements, outElementsMap, packageContexts, unmarshalAsJaxbElement, xmlTypeAsJaxbElementOnlyBUNDLE, LOG| Constructor and Description |
|---|
JAXBElementProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAttachmentMarshaller(Marshaller ms) |
protected void |
addAttachmentUnmarshaller(Unmarshaller um) |
protected boolean |
canBeReadAsJaxbElement(Class<?> type) |
protected Object |
doUnmarshal(Unmarshaller unmarshaller,
Class<?> type,
InputStream is,
Annotation[] anns,
javax.ws.rs.core.MediaType mt) |
protected XMLStreamReader |
getStreamReader(InputStream is,
Class<?> type,
javax.ws.rs.core.MediaType mt) |
protected XMLStreamWriter |
getStreamWriter(Object obj,
OutputStream os,
javax.ws.rs.core.MediaType mt) |
protected void |
marshal(Object obj,
Class<?> cls,
Type genericType,
String enc,
OutputStream os,
Annotation[] anns,
javax.ws.rs.core.MediaType mt,
Marshaller ms) |
protected void |
marshal(Object obj,
Class<?> cls,
Type genericType,
String enc,
OutputStream os,
javax.ws.rs.core.MediaType mt) |
protected void |
marshal(Object obj,
Class<?> cls,
Type genericType,
String enc,
OutputStream os,
javax.ws.rs.core.MediaType mt,
Annotation[] anns) |
protected void |
marshalCollection(Class<?> originalCls,
Object collection,
Type genericType,
String enc,
OutputStream os,
javax.ws.rs.core.MediaType m,
Annotation[] anns) |
protected void |
marshalCollectionMember(Object obj,
Class<?> cls,
Type genericType,
String enc,
OutputStream os,
Annotation[] anns,
javax.ws.rs.core.MediaType mt,
String ns) |
protected void |
marshalToOutputStream(Marshaller ms,
Object obj,
OutputStream os,
Annotation[] anns,
javax.ws.rs.core.MediaType mt) |
protected void |
marshalToWriter(Marshaller ms,
Object obj,
XMLStreamWriter writer,
Annotation[] anns,
javax.ws.rs.core.MediaType mt) |
protected boolean |
objectFactoryOrIndexAvailable(Class<?> type) |
T |
readFrom(Class<T> type,
Type genericType,
Annotation[] anns,
javax.ws.rs.core.MediaType mt,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
InputStream is) |
protected String |
resolveXMLResourceURI(String path) |
void |
setConsumeMediaTypes(List<String> types)
Sets custom Consumes media types; can be used to override static
Consumes annotation value set on the provider. |
void |
setEnableBuffering(boolean enableBuf)
Enables the buffering mode.
|
void |
setMarshallerProperties(Map<String,Object> marshallProperties) |
void |
setMessageContext(MessageContext mc) |
void |
setNamespacePrefixes(Map<String,String> prefixes) |
void |
setProduceMediaTypes(List<String> types)
Sets custom Produces media types; can be used to override static
Produces annotation value set on the provider. |
void |
setSchemaLocation(String schemaLocation) |
protected void |
setXmlPiProperty(Marshaller ms,
String value) |
void |
setXmlPiPropertyName(String xmlPiPropertyName) |
void |
setXmlResourceOffset(String value) |
protected Object |
unmarshalFromInputStream(Unmarshaller unmarshaller,
InputStream is,
Annotation[] anns,
javax.ws.rs.core.MediaType mt) |
protected Object |
unmarshalFromReader(Unmarshaller unmarshaller,
XMLStreamReader reader,
Annotation[] anns,
javax.ws.rs.core.MediaType mt) |
void |
writeTo(T obj,
Class<?> cls,
Type genericType,
Annotation[] anns,
javax.ws.rs.core.MediaType m,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
OutputStream os) |
checkAdapter, clearContexts, configureReaderRestrictions, convertToJaxbElementIfNeeded, createDepthReaderIfNeeded, createMarshaller, createTransformReaderIfNeeded, createTransformWriterIfNeeded, createUnmarshaller, createUnmarshaller, getActualType, getClassContext, getClassContext, getCollectionContext, getCollectionWrapperQName, getContext, getDepthProperties, getJAXBContext, getJaxbElementClass, getJaxbQName, getPackageContext, getPackageContext, getSchema, getSchema, getSize, getStreamHandlerFromCurrentMessage, handleExceptionEnd, handleExceptionStart, handleJAXBException, handleXMLStreamException, init, isReadable, isSkipJaxbChecks, isSupported, isWriteable, isXmlRoot, isXmlType, setAttributesToElements, setCatalogLocation, setCollectionWrapperMap, setCollectionWrapperName, setContext, setContextProperties, setDepthProperties, setExtraClass, setInAppendElements, setInDropElements, setInTransformElements, setJaxbElementClassMap, setJaxbElementClassNames, setMarshallAsJaxbElement, setMarshallerListener, setMarshallerProp, setNamespaceMapper, setNamespaceMapperPropertyName, setOutAppendElements, setOutDropElements, setOutTransformElements, setSchema, setSchemaHandler, setSchemaHandlers, setSchemaLocations, setSingleJaxbContext, setSkipJaxbChecks, setUnmarshallAsJaxbElement, setUnmarshallerListener, setUnmarshallerProperties, setUseSingleContextForPackages, setValidateBeforeWrite, setValidateInput, setValidateOutput, setValidationHandler, setXmlRootAsJaxbElement, setXmlTypeAsJaxbElementOnly, validateObjectIfNeeded, writeTogetBus, getConsumeMediaTypes, getEnableBuffering, getEnableStreaming, getProduceMediaTypes, isPayloadEmpty, isPayloadEmpty, reportEmptyContentLength, setBus, setEnableStreamingprotected boolean objectFactoryOrIndexAvailable(Class<?> type)
objectFactoryOrIndexAvailable in class AbstractJAXBProvider<T>public void setXmlResourceOffset(String value)
protected void setXmlPiProperty(Marshaller ms, String value) throws Exception
Exceptionprotected boolean canBeReadAsJaxbElement(Class<?> type)
canBeReadAsJaxbElement in class AbstractJAXBProvider<T>@Context public void setMessageContext(MessageContext mc)
public void setEnableBuffering(boolean enableBuf)
AbstractConfigurableProvidersetEnableBuffering in class AbstractConfigurableProviderenableBuf - the value of the buffering mode, false is default.public void setConsumeMediaTypes(List<String> types)
AbstractConfigurableProviderConsumes annotation value set on the provider.setConsumeMediaTypes in class AbstractConfigurableProvidertypes - the media typespublic void setProduceMediaTypes(List<String> types)
AbstractConfigurableProviderProduces annotation value set on the provider.setProduceMediaTypes in class AbstractConfigurableProvidertypes - the media typespublic void setSchemaLocation(String schemaLocation)
public T readFrom(Class<T> type, Type genericType, Annotation[] anns, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is) throws IOException
IOExceptionprotected Object doUnmarshal(Unmarshaller unmarshaller, Class<?> type, InputStream is, Annotation[] anns, javax.ws.rs.core.MediaType mt) throws JAXBException
JAXBExceptionprotected XMLStreamReader getStreamReader(InputStream is, Class<?> type, javax.ws.rs.core.MediaType mt)
protected Object unmarshalFromInputStream(Unmarshaller unmarshaller, InputStream is, Annotation[] anns, javax.ws.rs.core.MediaType mt) throws JAXBException
JAXBExceptionprotected Object unmarshalFromReader(Unmarshaller unmarshaller, XMLStreamReader reader, Annotation[] anns, javax.ws.rs.core.MediaType mt) throws JAXBException
JAXBExceptionpublic void writeTo(T obj, Class<?> cls, Type genericType, Annotation[] anns, javax.ws.rs.core.MediaType m, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os) throws IOException
IOExceptionprotected void marshalCollection(Class<?> originalCls, Object collection, Type genericType, String enc, OutputStream os, javax.ws.rs.core.MediaType m, Annotation[] anns) throws Exception
Exceptionprotected void marshalCollectionMember(Object obj, Class<?> cls, Type genericType, String enc, OutputStream os, Annotation[] anns, javax.ws.rs.core.MediaType mt, String ns) throws Exception
Exceptionprotected void marshal(Object obj, Class<?> cls, Type genericType, String enc, OutputStream os, javax.ws.rs.core.MediaType mt) throws Exception
Exceptionprotected void marshal(Object obj, Class<?> cls, Type genericType, String enc, OutputStream os, javax.ws.rs.core.MediaType mt, Annotation[] anns) throws Exception
Exceptionprotected void addAttachmentMarshaller(Marshaller ms)
protected void addAttachmentUnmarshaller(Unmarshaller um)
protected void marshal(Object obj, Class<?> cls, Type genericType, String enc, OutputStream os, Annotation[] anns, javax.ws.rs.core.MediaType mt, Marshaller ms) throws Exception
Exceptionprotected XMLStreamWriter getStreamWriter(Object obj, OutputStream os, javax.ws.rs.core.MediaType mt)
protected void marshalToOutputStream(Marshaller ms, Object obj, OutputStream os, Annotation[] anns, javax.ws.rs.core.MediaType mt) throws Exception
Exceptionprotected void marshalToWriter(Marshaller ms, Object obj, XMLStreamWriter writer, Annotation[] anns, javax.ws.rs.core.MediaType mt) throws Exception
Exceptionpublic void setXmlPiPropertyName(String xmlPiPropertyName)
Apache CXF