Package com.vaadin.hilla
Class EndpointCodeGenerator
java.lang.Object
com.vaadin.hilla.EndpointCodeGenerator
Handles (re)generation of the TypeScript code.
-
Constructor Summary
ConstructorsConstructorDescriptionEndpointCodeGenerator
(VaadinContext context, EndpointController endpointController) Creates the singleton. -
Method Summary
Modifier and TypeMethodDescriptionfindBrowserCallables
(EngineConfiguration engineConfiguration, org.springframework.context.ApplicationContext applicationContext) Finds all beans in the application context that have a browser callable annotation.static EndpointCodeGenerator
Gets the singleton instance.void
Re-generates the endpoint TypeScript and re-registers the endpoints in Java.
-
Constructor Details
-
EndpointCodeGenerator
Creates the singleton.- Parameters:
context
- the context the application is running inendpointController
- a reference to the endpoint controller
-
-
Method Details
-
getInstance
Gets the singleton instance. -
update
Re-generates the endpoint TypeScript and re-registers the endpoints in Java.- Parameters:
proposedNewBrowserCallables
- Some classes that might be new browser callables, for example coming from a hotswap event.
-
findBrowserCallables
public static List<Class<?>> findBrowserCallables(EngineConfiguration engineConfiguration, org.springframework.context.ApplicationContext applicationContext) Finds all beans in the application context that have a browser callable annotation.- Parameters:
engineConfiguration
- the engine configuration that provides the annotations to search forapplicationContext
- the application context to search for beans in- Returns:
- a list of classes that qualify as browser callables
-
getClassesUsedInOpenApi
- Throws:
IOException
-