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:
jakarta.ws.rs.ext.MessageBodyReader<T>
,jakarta.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 jakarta.ws.rs.ext.MessageBodyReader<T>, jakarta.ws.rs.ext.MessageBodyWriter<T>
-
Field Summary
Fields inherited from class org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
BUNDLE, LOG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
getSize
(T t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) boolean
isReadable
(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt) protected boolean
keepEncoded
(Annotation[] anns) protected void
persistParamsOnMessage
(jakarta.ws.rs.core.MultivaluedMap<String, String> params) protected void
populateMap
(jakarta.ws.rs.core.MultivaluedMap<String, String> params, Annotation[] anns, InputStream is, jakarta.ws.rs.core.MediaType mt, boolean decode) Retrieve map of parameters from the passed in messagereadFrom
(Class<T> clazz, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, InputStream is) void
void
setAttachmentMaxSize
(String maxSize) void
setAttachmentThreshold
(String threshold) void
setExpectedEncoded
(boolean expect) void
setValidator
(FormValidator formValidator) protected void
validateMap
(jakarta.ws.rs.core.MultivaluedMap<String, String> params) void
writeTo
(T obj, Class<?> c, Type t, Annotation[] anns, jakarta.ws.rs.core.MediaType mt, jakarta.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
-
Constructor Details
-
FormEncodingProvider
public FormEncodingProvider() -
FormEncodingProvider
public FormEncodingProvider(boolean expectEncoded)
-
-
Method Details
-
setExpectedEncoded
public void setExpectedEncoded(boolean expect) -
setAttachmentDirectory
-
setAttachmentThreshold
-
setAttachmentMaxSize
-
setValidator
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt) - Specified by:
isReadable
in interfacejakarta.ws.rs.ext.MessageBodyReader<T>
-
readFrom
public T readFrom(Class<T> clazz, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, InputStream is) throws IOException- Specified by:
readFrom
in interfacejakarta.ws.rs.ext.MessageBodyReader<T>
- Throws:
IOException
-
keepEncoded
-
persistParamsOnMessage
-
createMap
protected jakarta.ws.rs.core.MultivaluedMap<String,String> createMap(Class<?> clazz) throws Exception - Throws:
Exception
-
populateMap
protected void populateMap(jakarta.ws.rs.core.MultivaluedMap<String, String> params, Annotation[] anns, InputStream is, jakarta.ws.rs.core.MediaType mt, boolean decode) Retrieve map of parameters from the passed in message -
validateMap
-
getSize
public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
getSize
in interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mt) - Specified by:
isWriteable
in interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
-
writeTo
public void writeTo(T obj, Class<?> c, Type t, Annotation[] anns, jakarta.ws.rs.core.MediaType mt, jakarta.ws.rs.core.MultivaluedMap<String, Object> headers, OutputStream os) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
writeTo
in interfacejakarta.ws.rs.ext.MessageBodyWriter<T>
- Throws:
IOException
jakarta.ws.rs.WebApplicationException
-