@Retention(value=RUNTIME) @Target(value={METHOD,PARAMETER,CONSTRUCTOR,FIELD}) public @interface RequestObject
RequestConverterFunction.
A RequestObject can be implicitly applied when:
RequestConverter annotation is specified on a parameter in an annotated method
or a setter of a bean.RequestConverter annotation is specified on a field of a bean.RequestConverter annotation is specified on a method or constructor which has
only one parameter.RequestObject implicitly.
> @RequestConverter(ErinConverter.class)
> @RequestConverter(FrankConverter.class)
> public class CompositeBean {
> private final Alice a;
>
> @RequestConverter(BobConverter.class) // @RequestObject would be applied implicitly.
> private Bob b;
>
> private Charlie c;
> private David d;
> private Erin e;
>
> @RequestObject
> private Frank f; // Would be converted by the class-level converter.
>
> private String g; // No conversion would be performed. 'null' would be set.
>
> @RequestConverter(AliceConverter.class) // @RequestObject would be applied implicitly.
> public CompositeBean(Alice a) { ... }
>
> @RequestConverter(CharlieConverter.class) // @RequestObject would be applied implicitly.
> public void setCharlie(Charlie c) { ... }
>
> // @RequestObject would be applied implicitly.
> public void setDavidAndErin(@RequestConverter(DavidConverter.class) David d, Erin e) { ... }
> }
RequestConverterFunction,
RequestConverterCopyright © 2020 LeanCloud. All rights reserved.