Class FormDataOutputMapperGenerator
- java.lang.Object
-
- io.quarkus.resteasy.reactive.server.deployment.FormDataOutputMapperGenerator
-
final class FormDataOutputMapperGenerator extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static String
generate(org.jboss.jandex.ClassInfo returnTypeClassInfo, io.quarkus.gizmo.ClassOutput classOutput, org.jboss.jandex.IndexView index)
Generates a class that map a Pojo intoPartItem
that is then used byMultipartMessageBodyWriter
.static boolean
isReturnTypeCompatible(org.jboss.jandex.ClassInfo returnTypeClassInfo, org.jboss.jandex.IndexView index)
Returns true whether the returning type uses eitherRestForm
orFormData
annotations.
-
-
-
Method Detail
-
isReturnTypeCompatible
public static boolean isReturnTypeCompatible(org.jboss.jandex.ClassInfo returnTypeClassInfo, org.jboss.jandex.IndexView index)
Returns true whether the returning type uses eitherRestForm
orFormData
annotations.
-
generate
static String generate(org.jboss.jandex.ClassInfo returnTypeClassInfo, io.quarkus.gizmo.ClassOutput classOutput, org.jboss.jandex.IndexView index)
Generates a class that map a Pojo intoPartItem
that is then used byMultipartMessageBodyWriter
.For example for a pojo like:
public class FormData { @RestForm @PartType(MediaType.TEXT_PLAIN) private String text; @RestForm @PartType(MediaType.APPLICATION_OCTET_STREAM) public File file; public String getText() { return text; } public void setText(String text) { this.text = text; } public File getFile() { return file; } public void setFile(File file) { this.file = file; } }
The generated mapper would look like:
public class FormData_generated_mapper implements MultipartOutputInjectionTarget { public FormDataOutput mapFrom(Object var1) { FormDataOutput var2 = new FormDataOutput(); FormData var4 = (FormData) var1; File var3 = var4.data; MultipartSupport.addPartItemToFormDataOutput(var2, "file", "application/octet-stream", var3); File var5 = var4.text; MultipartSupport.addPartItemToFormDataOutput(var2, "text", "text/plain", var5); return var2; } }
-
-