Class RestClients
java.lang.Object
com.codename1.io.rest.RestClients
Runtime registry that wires
@RestClient-annotated interfaces to
the build-time-generated implementations. The generated
cn1app.RestClientBootstrap calls register(Class, Factory)
for every API interface in the project; user code reaches them
via the static of(String baseUrl) factory that
cn1:generate-openapi puts on each interface, and that factory
in turn calls create(Class, String) here.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFactory the generated bootstrap registers per API interface. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TReturns a freshly-built client for the requested API.static <T> voidregister(java.lang.Class<T> apiType, RestClients.Factory<T> factory) Registers a factory for an@RestClient-annotated interface.
-
Method Details
-
register
Registers a factory for an@RestClient-annotated interface. Called from the generatedcn1app.RestClientBootstrapso the REST plumbing is set up before the first<Api>.of(baseUrl)call. -
create
Returns a freshly-built client for the requested API. Called by thestatic of(String baseUrl)factory emitted on every generated@RestClientinterface.
-