Class DefaultFormElementTemplateLoader

    • Method Detail

      • classPath

        public static IPluginFormElementTemplateLoader classPath​(Class<?> classPath)
        Creates a loader that loads icons and the persist JSON from the class path, using the given class path loader. The URIs must have their scheme set to classpath and their path to the absolute path of the class path resource. For example:
         classpath:/path/to/icon.png
         
        Parameters:
        classPath - Class from which to load resources.
        Returns:
        A loader that loads resources from the class path.
      • classPath

        public static IPluginFormElementTemplateLoader classPath​(ClassLoader classPath)
        Creates a loader that loads icons and the persist JSON from the class path, using the given class path loader. The URIs must have their scheme set to classpath and their path to the absolute path of the class path resource. For example:
         classpath:/path/to/icon.png
         
        Parameters:
        classPath - Class from which to load resources.
        Returns:
        A loader that loads resources from the class path.
      • map

        public static IPluginFormElementTemplateLoader map​(Map<URI,​String> persistJsonMap,
                                                           Map<URI,​byte[]> iconMap)
        Creates a loader for static in-memory resources from the given maps. Use with care, as large in-memory resources may result in out-of-memory errors.
        Parameters:
        persistJsonMap - Map with the persist JSON content for each supported URI. Each value must be a valid JSON string.
        iconMap - Map with the icons for each supported URI.
        Returns:
        A custom loader using the given loader functions.
      • mapBase64

        public static IPluginFormElementTemplateLoader mapBase64​(Map<URI,​String> persistJsonMap,
                                                                 Map<URI,​String> iconMap)
        Creates a loader for static in-memory resources from the given maps. Use with care, as large in-memory resources may result in out-of-memory errors.
        Parameters:
        persistJsonMap - Map with the persist JSON content for each supported URI. Each value must be a valid JSON string.
        iconMap - Map with the icons for each supported URI. Each value must be a valid base64 string.
        Returns:
        A custom loader using the given loader functions.
      • url

        public static IPluginFormElementTemplateLoader url()
        Creates a loader that converts the URIs to URLs and reads the data from the URL.
        Returns:
        A loader that expects URIs to represent valid URLs.