Class ViewTemplateControllerClassFactory

java.lang.Object
io.jmix.flowui.view.template.impl.ViewTemplateControllerClassFactory

@Component("flowui_ViewTemplateControllerClassFactory") public class ViewTemplateControllerClassFactory extends Object
Generates dedicated controller classes for template-based views.
  • Field Details

    • GENERATED_PACKAGE_SUFFIX

      protected static final String GENERATED_PACKAGE_SUFFIX
      See Also:
    • NON_ROUTE_CHARS

      protected static final Pattern NON_ROUTE_CHARS
    • EDGE_SEPARATORS

      protected static final Pattern EDGE_SEPARATORS
    • controllerClasses

      protected Map<String,Class<? extends View<?>>> controllerClasses
  • Constructor Details

    • ViewTemplateControllerClassFactory

      public ViewTemplateControllerClassFactory()
  • Method Details

    • createListViewControllerClass

      public Class<? extends View<?>> createListViewControllerClass(MetaClass entityMetaClass, String viewId, String descriptorPath, String routePath, String lookupComponentId)
      Returns a generated controller class for the specified list template view.
      Parameters:
      entityMetaClass - entity meta-class that owns the generated view
      viewId - view id to expose through ViewController
      descriptorPath - descriptor path exposed through ViewDescriptor
      routePath - route path exposed through Route
      lookupComponentId - lookup component id used by the generated controller
      Returns:
      generated controller class
    • createDetailViewControllerClass

      public Class<? extends View<?>> createDetailViewControllerClass(MetaClass entityMetaClass, String viewId, String descriptorPath, String routePath, String editedEntityContainerId)
      Returns a generated controller class for the specified detail template view.
      Parameters:
      entityMetaClass - entity meta-class that owns the generated view
      viewId - view id to expose through ViewController
      descriptorPath - descriptor path exposed through ViewDescriptor
      routePath - route path exposed through Route
      editedEntityContainerId - edited entity container id used by the generated controller
      Returns:
      generated controller class
    • createListViewControllerClassInternal

      protected Class<? extends View<?>> createListViewControllerClassInternal(MetaClass entityMetaClass, String viewId, String descriptorPath, String routePath, String lookupComponentId)
    • createDetailViewControllerClassInternal

      protected Class<? extends View<?>> createDetailViewControllerClassInternal(MetaClass entityMetaClass, String viewId, String descriptorPath, String routePath, String editedEntityContainerId)
    • createControllerClassBuilder

      protected net.bytebuddy.dynamic.DynamicType.Builder<? extends View<?>> createControllerClassBuilder(MetaClass entityMetaClass, ViewTemplateType type, Class<? extends View<?>> superclass, String viewId, String descriptorPath, String routePath)
    • createDefaultRoutePath

      public String createDefaultRoutePath(String viewId, ViewTemplateType type)
      Creates the default route path for a template view when the annotation does not provide one.
      Parameters:
      viewId - template view id
      type - template view type
      Returns:
      generated route path
    • createClassName

      protected String createClassName(MetaClass entityMetaClass, ViewTemplateType type)
    • createRouteSlug

      protected String createRouteSlug(String value)
    • findLoadedClass

      protected @Nullable Class<?> findLoadedClass(String className, ClassLoader classLoader)