public abstract class AbstractJAXBProvider<T> extends AbstractConfigurableProvider implements javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractJAXBProvider.CollectionWrapper |
protected static class |
AbstractJAXBProvider.JAXBCollectionWrapperReader |
| Modifier and Type | Field and Description |
|---|---|
protected Map<Class<?>,JAXBContext> |
classContexts |
protected Set<Class<?>> |
collectionContextClasses |
protected Map<String,String> |
inAppendMap |
protected List<String> |
inDropElements |
protected Map<String,String> |
inElementsMap |
protected Map<String,String> |
jaxbElementClassMap |
protected boolean |
marshalAsJaxbElement |
protected static String |
NS_MAPPER_PROPERTY_RI |
protected static String |
NS_MAPPER_PROPERTY_RI_INT |
protected Map<String,Boolean> |
objectFactoryOrIndexMap |
protected Map<String,String> |
outAppendMap |
protected List<String> |
outDropElements |
protected Map<String,String> |
outElementsMap |
protected Map<String,JAXBContext> |
packageContexts |
protected boolean |
unmarshalAsJaxbElement |
protected boolean |
xmlTypeAsJaxbElementOnly |
BUNDLE, LOG| Constructor and Description |
|---|
AbstractJAXBProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canBeReadAsJaxbElement(Class<?> type) |
protected static Object |
checkAdapter(Object obj,
Class<?> cls,
Annotation[] anns,
boolean marshal) |
void |
clearContexts() |
protected XMLStreamReader |
configureReaderRestrictions(XMLStreamReader reader) |
protected Object |
convertToJaxbElementIfNeeded(Object obj,
Class<?> cls,
Type genericType) |
protected XMLStreamReader |
createDepthReaderIfNeeded(XMLStreamReader reader,
InputStream is) |
protected Marshaller |
createMarshaller(Object obj,
Class<?> cls,
Type genericType,
String enc) |
protected XMLStreamReader |
createTransformReaderIfNeeded(XMLStreamReader reader,
InputStream is) |
protected XMLStreamWriter |
createTransformWriterIfNeeded(XMLStreamWriter writer,
OutputStream os,
boolean dropAtXmlLevel) |
protected Unmarshaller |
createUnmarshaller(Class<?> cls,
Type genericType) |
protected Unmarshaller |
createUnmarshaller(Class<?> cls,
Type genericType,
boolean isCollection) |
protected Class<?> |
getActualType(Class<?> type,
Type genericType,
Annotation[] anns) |
JAXBContext |
getClassContext(Class<?> type) |
protected JAXBContext |
getClassContext(Class<?> type,
Type genericType) |
protected JAXBContext |
getCollectionContext(Class<?> type) |
protected QName |
getCollectionWrapperQName(Class<?> cls,
Type type,
Object object,
boolean pluralName) |
protected MessageContext |
getContext() |
protected org.apache.cxf.staxutils.DocumentDepthProperties |
getDepthProperties() |
JAXBContext |
getJAXBContext(Class<?> type,
Type genericType) |
protected Class<?> |
getJaxbElementClass(Class<?> cls) |
protected QName |
getJaxbQName(Class<?> cls,
Type type,
Object object,
boolean pluralName) |
JAXBContext |
getPackageContext(Class<?> type) |
protected JAXBContext |
getPackageContext(Class<?> type,
Type genericType) |
protected Schema |
getSchema() |
protected Schema |
getSchema(Class<?> cls) |
long |
getSize(T o,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mt) |
protected <X> X |
getStreamHandlerFromCurrentMessage(Class<X> staxCls) |
protected static void |
handleExceptionEnd(Throwable t,
String message,
boolean read) |
protected static StringBuilder |
handleExceptionStart(Exception e) |
protected void |
handleJAXBException(JAXBException e,
boolean read) |
protected void |
handleXMLStreamException(XMLStreamException e,
boolean read) |
void |
init(List<ClassResourceInfo> cris)
Gives providers a chance to introspect the JAX-RS model classes.
|
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] anns,
javax.ws.rs.core.MediaType mt) |
boolean |
isSkipJaxbChecks() |
protected boolean |
isSupported(Class<?> type,
Type genericType,
Annotation[] anns) |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] anns,
javax.ws.rs.core.MediaType mt) |
protected boolean |
isXmlRoot(Class<?> cls) |
protected boolean |
isXmlType(Class<?> cls) |
protected boolean |
objectFactoryOrIndexAvailable(Class<?> type) |
void |
setAttributesToElements(boolean value) |
void |
setCatalogLocation(String name) |
void |
setCollectionWrapperMap(Map<String,String> map) |
void |
setCollectionWrapperName(String wName) |
protected void |
setContext(MessageContext context) |
void |
setContextProperties(Map<String,Object> contextProperties) |
void |
setDepthProperties(org.apache.cxf.staxutils.DocumentDepthProperties depthProperties) |
void |
setExtraClass(Class<?>[] userExtraClass) |
void |
setInAppendElements(Map<String,String> inElements) |
void |
setInDropElements(List<String> dropElementsSet) |
void |
setInTransformElements(Map<String,String> inElements) |
void |
setJaxbElementClassMap(Map<String,String> map) |
void |
setJaxbElementClassNames(List<String> names) |
void |
setMarshallAsJaxbElement(boolean value) |
void |
setMarshallerListener(Marshaller.Listener marshallerListener) |
protected static void |
setMarshallerProp(Marshaller ms,
Object value,
String name1,
String name2) |
protected void |
setNamespaceMapper(Marshaller ms,
Map<String,String> map) |
void |
setNamespaceMapperPropertyName(String namespaceMapperProperty) |
void |
setOutAppendElements(Map<String,String> map) |
void |
setOutDropElements(List<String> dropElementsSet) |
void |
setOutTransformElements(Map<String,String> outElements) |
protected void |
setSchema(Schema s) |
void |
setSchemaHandler(SchemaHandler handler) |
void |
setSchemaHandlers(Map<String,SchemaHandler> handlers) |
void |
setSchemaLocations(List<String> locations) |
void |
setSingleJaxbContext(boolean useSingleContext) |
void |
setSkipJaxbChecks(boolean skipJaxbChecks) |
void |
setUnmarshallAsJaxbElement(boolean value) |
void |
setUnmarshallerListener(Unmarshaller.Listener unmarshallerListener) |
void |
setUnmarshallerProperties(Map<String,Object> unmarshalProperties) |
void |
setUseSingleContextForPackages(boolean use) |
void |
setValidateBeforeWrite(boolean validateBeforeWrite) |
void |
setValidateInput(boolean validateInput) |
void |
setValidateOutput(boolean validateOutput) |
void |
setValidationHandler(ValidationEventHandler handler) |
void |
setXmlRootAsJaxbElement(boolean xmlRootAsJaxbElement) |
void |
setXmlTypeAsJaxbElementOnly(boolean value) |
protected void |
validateObjectIfNeeded(Marshaller marshaller,
Class<?> cls,
Object obj) |
void |
writeTo(T t,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream) |
getBus, getConsumeMediaTypes, getEnableBuffering, getEnableStreaming, getProduceMediaTypes, isPayloadEmpty, isPayloadEmpty, reportEmptyContentLength, setBus, setConsumeMediaTypes, setEnableBuffering, setEnableStreaming, setProduceMediaTypesprotected static final String NS_MAPPER_PROPERTY_RI
protected static final String NS_MAPPER_PROPERTY_RI_INT
protected boolean unmarshalAsJaxbElement
protected boolean marshalAsJaxbElement
protected boolean xmlTypeAsJaxbElementOnly
protected Map<String,JAXBContext> packageContexts
protected Map<Class<?>,JAXBContext> classContexts
public void setXmlRootAsJaxbElement(boolean xmlRootAsJaxbElement)
protected void setNamespaceMapper(Marshaller ms, Map<String,String> map) throws Exception
Exceptionprotected static void setMarshallerProp(Marshaller ms, Object value, String name1, String name2) throws Exception
Exceptionpublic void setValidationHandler(ValidationEventHandler handler)
public void setSingleJaxbContext(boolean useSingleContext)
public void setUseSingleContextForPackages(boolean use)
public void setExtraClass(Class<?>[] userExtraClass)
public void init(List<ClassResourceInfo> cris)
AbstractConfigurableProviderinit in class AbstractConfigurableProviderpublic void setUnmarshallerProperties(Map<String,Object> unmarshalProperties)
public void setUnmarshallAsJaxbElement(boolean value)
public void setMarshallAsJaxbElement(boolean value)
public void setXmlTypeAsJaxbElementOnly(boolean value)
protected <X> X getStreamHandlerFromCurrentMessage(Class<X> staxCls)
protected boolean isXmlRoot(Class<?> cls)
protected boolean isXmlType(Class<?> cls)
protected Object convertToJaxbElementIfNeeded(Object obj, Class<?> cls, Type genericType) throws Exception
Exceptionpublic void setCollectionWrapperName(String wName)
protected void setContext(MessageContext context)
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] anns, javax.ws.rs.core.MediaType mt)
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>public void writeTo(T t, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException
IOExceptionjavax.ws.rs.WebApplicationExceptionprotected JAXBContext getCollectionContext(Class<?> type) throws JAXBException
JAXBExceptionprotected QName getCollectionWrapperQName(Class<?> cls, Type type, Object object, boolean pluralName) throws Exception
Exceptionprotected QName getJaxbQName(Class<?> cls, Type type, Object object, boolean pluralName) throws Exception
Exceptionpublic boolean isReadable(Class<?> type, Type genericType, Annotation[] anns, javax.ws.rs.core.MediaType mt)
isReadable in interface javax.ws.rs.ext.MessageBodyReader<T>protected boolean canBeReadAsJaxbElement(Class<?> type)
public void setCatalogLocation(String name)
public void setSchemaHandler(SchemaHandler handler)
public void setSchemaHandlers(Map<String,SchemaHandler> handlers)
protected void setSchema(Schema s)
public long getSize(T o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>protected MessageContext getContext()
public JAXBContext getJAXBContext(Class<?> type, Type genericType) throws JAXBException
JAXBExceptionpublic JAXBContext getClassContext(Class<?> type) throws JAXBException
JAXBExceptionprotected JAXBContext getClassContext(Class<?> type, Type genericType) throws JAXBException
JAXBExceptionpublic JAXBContext getPackageContext(Class<?> type)
protected JAXBContext getPackageContext(Class<?> type, Type genericType)
protected boolean isSupported(Class<?> type, Type genericType, Annotation[] anns)
protected boolean objectFactoryOrIndexAvailable(Class<?> type)
protected Unmarshaller createUnmarshaller(Class<?> cls, Type genericType) throws JAXBException
JAXBExceptionprotected Unmarshaller createUnmarshaller(Class<?> cls, Type genericType, boolean isCollection) throws JAXBException
JAXBExceptionprotected Marshaller createMarshaller(Object obj, Class<?> cls, Type genericType, String enc) throws JAXBException
JAXBExceptionprotected void validateObjectIfNeeded(Marshaller marshaller, Class<?> cls, Object obj) throws JAXBException
JAXBExceptionprotected Class<?> getActualType(Class<?> type, Type genericType, Annotation[] anns)
protected static Object checkAdapter(Object obj, Class<?> cls, Annotation[] anns, boolean marshal)
protected Schema getSchema()
public void clearContexts()
protected static StringBuilder handleExceptionStart(Exception e)
protected static void handleExceptionEnd(Throwable t, String message, boolean read)
protected void handleJAXBException(JAXBException e, boolean read)
protected void handleXMLStreamException(XMLStreamException e, boolean read)
public void setAttributesToElements(boolean value)
public void setSkipJaxbChecks(boolean skipJaxbChecks)
public boolean isSkipJaxbChecks()
protected XMLStreamWriter createTransformWriterIfNeeded(XMLStreamWriter writer, OutputStream os, boolean dropAtXmlLevel)
protected XMLStreamReader createTransformReaderIfNeeded(XMLStreamReader reader, InputStream is)
protected XMLStreamReader createDepthReaderIfNeeded(XMLStreamReader reader, InputStream is)
protected XMLStreamReader configureReaderRestrictions(XMLStreamReader reader)
protected org.apache.cxf.staxutils.DocumentDepthProperties getDepthProperties()
public void setValidateBeforeWrite(boolean validateBeforeWrite)
public void setValidateOutput(boolean validateOutput)
public void setValidateInput(boolean validateInput)
public void setDepthProperties(org.apache.cxf.staxutils.DocumentDepthProperties depthProperties)
public void setUnmarshallerListener(Unmarshaller.Listener unmarshallerListener)
public void setMarshallerListener(Marshaller.Listener marshallerListener)
public void setNamespaceMapperPropertyName(String namespaceMapperProperty)
Apache CXF