MCPcopy Index your code
hub / github.com/OpenFeign/feign / DelegateWriter

Class DelegateWriter

form/src/main/java/feign/form/multipart/DelegateWriter.java:32–53  ·  view source on GitHub ↗

A delegate writer. @author Artem Labazin

Source from the content-addressed store, hash-verified

30 * @author Artem Labazin
31 */
32@RequiredArgsConstructor
33@FieldDefaults(level = PRIVATE, makeFinal = true)
34public class DelegateWriter extends AbstractWriter {
35
36 Encoder delegate;
37
38 SingleParameterWriter parameterWriter = new SingleParameterWriter();
39
40 @Override
41 public boolean isApplicable(Object value) {
42 return true;
43 }
44
45 @Override
46 protected void write(Output output, String key, Object value) throws EncodeException {
47 val fake = new RequestTemplate();
48 delegate.encode(value, value.getClass(), fake);
49 val bytes = fake.body();
50 val string = new String(bytes, output.getCharset()).replaceAll("\n", "");
51 parameterWriter.write(output, key, string);
52 }
53}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected