Class EndpointCodeGenerator

java.lang.Object
com.vaadin.hilla.EndpointCodeGenerator

@Component public class EndpointCodeGenerator extends Object
Handles (re)generation of the TypeScript code.
  • Constructor Details

    • EndpointCodeGenerator

      public EndpointCodeGenerator(VaadinContext context, EndpointController endpointController)
      Creates the singleton.
      Parameters:
      context - the context the application is running in
      endpointController - a reference to the endpoint controller
  • Method Details

    • getInstance

      public static EndpointCodeGenerator getInstance()
      Gets the singleton instance.
    • update

      public void update(String... proposedNewBrowserCallables)
      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 for
      applicationContext - the application context to search for beans in
      Returns:
      a list of classes that qualify as browser callables
    • getClassesUsedInOpenApi

      public Optional<Set<String>> getClassesUsedInOpenApi() throws IOException
      Throws:
      IOException