Class List Method List File List

# Class: VertxWeb::FreeMarkerTemplateEngine

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

## Overview

A template engine that uses the FreeMarker library.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

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

## Instance Method Summary (collapse)

- - (true, false) caching_enabled?
- - (void) render(arg0 = nil, arg1 = nil, arg2 = nil) { ... }
- - (self) set_extension(extension = nil)
  Set the extension for the engine.
- - (self) set_max_cache_size(maxCacheSize = nil)
  Set the max cache size 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/free_marker_template_engine.rb', line 21

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

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

Create a template engine using defaults

Returns:

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

Raises:

- (`ArgumentError`)

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

    def self.create
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebTempl::FreeMarkerTemplateEngine.java_method(:create, []).call(),::VertxWeb::FreeMarkerTemplateEngine)
      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/free_marker_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/free_marker_template_engine.rb', line 33

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

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

    27
    28
    29
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/free_marker_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/free_marker_template_engine.rb', line 24

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

## Instance Method Details

### - (`true`, `false`) caching_enabled?

Returns:

- (`true`, `false`)

Raises:

- (`ArgumentError`)

    50
    51
    52
    53
    54
    55
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/free_marker_template_engine.rb', line 50

    def caching_enabled?
      if !block_given?
        return @j_del.java_method(:isCachingEnabled, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling caching_enabled?()"
    end

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

This method returns an undefined value.

Parameters:

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

Yields:

Raises:

- (`ArgumentError`)

    41
    42
    43
    44
    45
    46
    47
    48
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/free_marker_template_engine.rb', line 41

    def render(arg0=nil,arg1=nil,arg2=nil)
      if arg0.class.method_defined?(:j_del) && arg1.class == String && block_given? && arg2 == nil
        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) }))
      elsif arg0.class.method_defined?(:j_del) && arg1.class == String && arg2.class == String && block_given?
        return @j_del.java_method(:render, [Java::IoVertxExtWeb::RoutingContext.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(arg0.j_del,arg1,arg2,(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},#{arg2})"
    end

### - (`self`) set_extension(extension = nil)

Set the extension for the engine

Parameters:

- extension (`String`) (defaults to: `nil`) —
  the extension

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    67
    68
    69
    70
    71
    72
    73
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/free_marker_template_engine.rb', line 67

    def set_extension(extension=nil)
      if extension.class == String && !block_given?
        @j_del.java_method(:setExtension, [Java::java.lang.String.java_class]).call(extension)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_extension(#{extension})"
    end

### - (`self`) set_max_cache_size(maxCacheSize = nil)

Set the max cache size for the engine

Parameters:

- maxCacheSize (`Fixnum`) (defaults to: `nil`) —
  the maxCacheSize

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    77
    78
    79
    80
    81
    82
    83
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/free_marker_template_engine.rb', line 77

    def set_max_cache_size(maxCacheSize=nil)
      if maxCacheSize.class == Fixnum && !block_given?
        @j_del.java_method(:setMaxCacheSize, [Java::int.java_class]).call(maxCacheSize)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_max_cache_size(#{maxCacheSize})"
    end