Class TemplateEngine

    • Constructor Detail

      • TemplateEngine

        public TemplateEngine​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • render

        public void render​(JsonObject context,
                           String templateFileName,
                           Handler<AsyncResult<Buffer>> handler)
        Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".
        Parameters:
        context - the routing context
        templateFileName - the template file name to use
        handler - the handler that will be called with a result containing the buffer or a failure.
      • render

        public void render​(JsonObject context,
                           String templateFileName)
        Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".
        Parameters:
        context - the routing context
        templateFileName - the template file name to use
      • rxRender

        public io.reactivex.Single<Buffer> rxRender​(JsonObject context,
                                                    String templateFileName)
        Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".
        Parameters:
        context - the routing context
        templateFileName - the template file name to use
        Returns:
      • clearCache

        public void clearCache()
        Clears any internal caches used by this engine. For most engines this means clearing the vert.x cache, implementations that do not use vert.x as a cache should clear their own cache.
      • render

        public void render​(Map<String,​Object> context,
                           String templateFileName,
                           Handler<AsyncResult<Buffer>> handler)
        Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".
        Parameters:
        context - the routing context
        templateFileName - the template file name to use
        handler - the handler that will be called with a result containing the buffer or a failure.
      • render

        public void render​(Map<String,​Object> context,
                           String templateFileName)
        Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".
        Parameters:
        context - the routing context
        templateFileName - the template file name to use
      • rxRender

        public io.reactivex.Single<Buffer> rxRender​(Map<String,​Object> context,
                                                    String templateFileName)
        Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".
        Parameters:
        context - the routing context
        templateFileName - the template file name to use
        Returns:
      • unwrap

        public <T> T unwrap()
        Returns the underlying engine, so further configurations or customizations may be applied.
        Returns:
        the engine instance.