Package org.apache.cxf.jaxrs.provider
Class FormEncodingProvider<T>
- java.lang.Object
-
- org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
-
- org.apache.cxf.jaxrs.provider.FormEncodingProvider<T>
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>
,javax.ws.rs.ext.MessageBodyWriter<T>
@Produces({"application/x-www-form-urlencoded","multipart/form-data"}) @Consumes({"application/x-www-form-urlencoded","multipart/form-data"}) @Provider public class FormEncodingProvider<T> extends AbstractConfigurableProvider implements javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<T>
-
-
Field Summary
-
Fields inherited from class org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
BUNDLE, LOG
-
-
Constructor Summary
Constructors Constructor Description FormEncodingProvider()
FormEncodingProvider(boolean expectEncoded)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.ws.rs.core.MultivaluedMap<String,String>
createMap(Class<?> clazz)
long
getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
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
keepEncoded(Annotation[] anns)
protected void
persistParamsOnMessage(javax.ws.rs.core.MultivaluedMap<String,String> params)
protected void
populateMap(javax.ws.rs.core.MultivaluedMap<String,String> params, Annotation[] anns, InputStream is, javax.ws.rs.core.MediaType mt, boolean decode)
Retrieve map of parameters from the passed in messageT
readFrom(Class<T> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is)
void
setAttachmentDirectory(String dir)
void
setAttachmentMaxSize(String maxSize)
void
setAttachmentThreshold(String threshold)
void
setExpectedEncoded(boolean expect)
void
setValidator(FormValidator formValidator)
protected void
validateMap(javax.ws.rs.core.MultivaluedMap<String,String> params)
void
writeTo(T obj, Class<?> c, Type t, Annotation[] anns, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os)
-
Methods inherited from class org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
getBus, getConsumeMediaTypes, getEnableBuffering, getEnableStreaming, getProduceMediaTypes, init, isPayloadEmpty, isPayloadEmpty, reportEmptyContentLength, setBus, setConsumeMediaTypes, setEnableBuffering, setEnableStreaming, setProduceMediaTypes
-
-
-
-
Method Detail
-
setExpectedEncoded
public void setExpectedEncoded(boolean expect)
-
setAttachmentDirectory
public void setAttachmentDirectory(String dir)
-
setAttachmentThreshold
public void setAttachmentThreshold(String threshold)
-
setAttachmentMaxSize
public void setAttachmentMaxSize(String maxSize)
-
setValidator
public void setValidator(FormValidator formValidator)
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
- Specified by:
isReadable
in interfacejavax.ws.rs.ext.MessageBodyReader<T>
-
readFrom
public T readFrom(Class<T> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is) throws IOException
- Specified by:
readFrom
in interfacejavax.ws.rs.ext.MessageBodyReader<T>
- Throws:
IOException
-
keepEncoded
protected boolean keepEncoded(Annotation[] anns)
-
persistParamsOnMessage
protected void persistParamsOnMessage(javax.ws.rs.core.MultivaluedMap<String,String> params)
-
createMap
protected javax.ws.rs.core.MultivaluedMap<String,String> createMap(Class<?> clazz) throws Exception
- Throws:
Exception
-
populateMap
protected void populateMap(javax.ws.rs.core.MultivaluedMap<String,String> params, Annotation[] anns, InputStream is, javax.ws.rs.core.MediaType mt, boolean decode)
Retrieve map of parameters from the passed in message
-
getSize
public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
getSize
in interfacejavax.ws.rs.ext.MessageBodyWriter<T>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
- Specified by:
isWriteable
in interfacejavax.ws.rs.ext.MessageBodyWriter<T>
-
writeTo
public void writeTo(T obj, Class<?> c, Type t, Annotation[] anns, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os) throws IOException, javax.ws.rs.WebApplicationException
- Specified by:
writeTo
in interfacejavax.ws.rs.ext.MessageBodyWriter<T>
- Throws:
IOException
javax.ws.rs.WebApplicationException
-
-