Class List Method List File List

# Class: VertxWeb::ThymeleafTemplateEngine

Inherits:
  TemplateEngine
  - Object
  - TemplateEngine
  - VertxWeb::ThymeleafTemplateEngine
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb

## Overview

A template engine that uses the Thymeleaf library.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxWeb::ThymeleafTemplateEngine) create
  Create a template engine using defaults.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) render(arg0 = nil, arg1 = nil) { ... }
- - (::VertxWeb::ThymeleafTemplateEngine) set_mode(mode = nil)
  Set the mode for the engine.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 21

    def @@j_api_type.accept?(obj)
      obj.class == ThymeleafTemplateEngine
    end

### + (`::VertxWeb::ThymeleafTemplateEngine`) create

Create a template engine using defaults

Returns:

- (`::VertxWeb::ThymeleafTemplateEngine`) —
  the engine

Raises:

- (`ArgumentError`)

    48
    49
    50
    51
    52
    53
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 48

    def self.create
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebTempl::ThymeleafTemplateEngine.java_method(:create, []).call(),::VertxWeb::ThymeleafTemplateEngine)
      end
      raise ArgumentError, "Invalid arguments when calling create()"
    end

### + (`Object`) j_api_type

    30
    31
    32
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 30

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    33
    34
    35
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 33

    def self.j_class
      Java::IoVertxExtWebTempl::ThymeleafTemplateEngine.java_class
    end

### + (`Object`) unwrap(obj)

    27
    28
    29
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 27

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    24
    25
    26
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 24

    def @@j_api_type.wrap(obj)
      ThymeleafTemplateEngine.new(obj)
    end

## Instance Method Details

### - (`void`) render(arg0 = nil, arg1 = nil) { ... }

This method returns an undefined value.

Parameters:

- arg0 (`::VertxWeb::RoutingContext`) (defaults to: `nil`)
- arg1 (`String`) (defaults to: `nil`)

Yields:

Raises:

- (`ArgumentError`)

    40
    41
    42
    43
    44
    45
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 40

    def render(arg0=nil,arg1=nil)
      if arg0.class.method_defined?(:j_del) && arg1.class == String && block_given?
        return @j_del.java_method(:render, [Java::IoVertxExtWeb::RoutingContext.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(arg0.j_del,arg1,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Buffer) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling render(#{arg0},#{arg1})"
    end

### - (`::VertxWeb::ThymeleafTemplateEngine`) set_mode(mode = nil)

Set the mode for the engine

Parameters:

- mode (`:HTML`, `:XML`, `:TEXT`, `:JAVASCRIPT`, `:CSS`, `:RAW`, `:HTML5`, `:LEGACYHTML5`, `:XHTML`, `:VALIDXHTML`, `:VALIDXML`) (defaults to: `nil`) —
  the mode

Returns:

- (`::VertxWeb::ThymeleafTemplateEngine`) —
  a reference to this for fluency

Raises:

- (`ArgumentError`)

    57
    58
    59
    60
    61
    62
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/thymeleaf_template_engine.rb', line 57

    def set_mode(mode=nil)
      if mode.class == Symbol && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setMode, [Java::OrgThymeleafTemplatemode::TemplateMode.java_class]).call(Java::OrgThymeleafTemplatemode::TemplateMode.valueOf(mode.to_s)),::VertxWeb::ThymeleafTemplateEngine)
      end
      raise ArgumentError, "Invalid arguments when calling set_mode(#{mode})"
    end