Class List Method List File List

# Class: VertxWeb::RoutingContext

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

## Instance Method Summary (collapse)

- - (Object) acceptable_locales
- - (Object) add_body_end_handler
- - (Object) add_cookie(cookie = nil)
- - (Object) add_headers_end_handler
- - (Object) clear_user
- - (Object) cookie_count
- - (Object) cookies
- - (Object) current_route
- - (Object) fail(param_1 = nil)
- - (Boolean) failed?
- - (Object) failure
- - (Object) file_uploads
- - (Object) get(key = nil)
- - (Object) get_acceptable_content_type
- - (Object) get_body
- - (Object) get_body_as_json
- - (Object) get_body_as_json_array
- - (Object) get_body_as_string(encoding = nil)
- - (Object) get_cookie(name = nil)
- - (RoutingContext) initialize(j_del) constructor
  A new instance of RoutingContext.
- - (Object) j_del
- - (Object) mount_point
- - (Object) next
- - (Object) normalised_path
- - (Object) path_param(name = nil)
- - (Object) path_params
- - (Object) preferred_locale
- - (Object) put(key = nil, obj = nil)
- - (Object) remove(key = nil)
- - (Boolean) remove_body_end_handler?(handlerID = nil)
- - (Object) remove_cookie(name = nil)
- - (Boolean) remove_headers_end_handler?(handlerID = nil)
- - (Object) request
- - (Object) reroute(param_1 = nil, param_2 = nil)
- - (Object) response
- - (Object) session
- - (Object) set_acceptable_content_type(contentType = nil)
- - (Object) set_body(body = nil)
- - (Object) set_session(session = nil)
- - (Object) set_user(user = nil)
- - (Object) status_code
- - (Object) user
- - (Object) vertx

## Constructor Details

### - (`RoutingContext`) initialize(j_del)

Returns a new instance of RoutingContext

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

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) acceptable_locales

Raises:

- (`ArgumentError`)

    412
    413
    414
    415
    416
    417
    418
    419
    420
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 412

    def acceptable_locales
      if !block_given?
        if @cached_acceptable_locales != nil
          return @cached_acceptable_locales
        end
        return @cached_acceptable_locales = @j_del.java_method(:acceptableLocales, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxWeb::Locale) }
      end
      raise ArgumentError, "Invalid arguments when calling acceptable_locales()"
    end

### - (`Object`) add_body_end_handler

Raises:

- (`ArgumentError`)

    322
    323
    324
    325
    326
    327
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 322

    def add_body_end_handler
      if block_given?
        return @j_del.java_method(:addBodyEndHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
      end
      raise ArgumentError, "Invalid arguments when calling add_body_end_handler()"
    end

### - (`Object`) add_cookie(cookie = nil)

Raises:

- (`ArgumentError`)

    171
    172
    173
    174
    175
    176
    177
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 171

    def add_cookie(cookie=nil)
      if cookie.class.method_defined?(:j_del) && !block_given?
        @j_del.java_method(:addCookie, [Java::IoVertxExtWeb::Cookie.java_class]).call(cookie.j_del)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling add_cookie(cookie)"
    end

### - (`Object`) add_headers_end_handler

Raises:

- (`ArgumentError`)

    301
    302
    303
    304
    305
    306
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 301

    def add_headers_end_handler
      if block_given?
        return @j_del.java_method(:addHeadersEndHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
      end
      raise ArgumentError, "Invalid arguments when calling add_headers_end_handler()"
    end

### - (`Object`) clear_user

Raises:

- (`ArgumentError`)

    374
    375
    376
    377
    378
    379
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 374

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

### - (`Object`) cookie_count

Raises:

- (`ArgumentError`)

    189
    190
    191
    192
    193
    194
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 189

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

### - (`Object`) cookies

Raises:

- (`ArgumentError`)

    196
    197
    198
    199
    200
    201
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 196

    def cookies
      if !block_given?
        return ::Vertx::Util::Utils.to_set(@j_del.java_method(:cookies, []).call()).map! { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxWeb::Cookie) }
      end
      raise ArgumentError, "Invalid arguments when calling cookies()"
    end

### - (`Object`) current_route

Raises:

- (`ArgumentError`)

    133
    134
    135
    136
    137
    138
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 133

    def current_route
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:currentRoute, []).call(),::VertxWeb::Route)
      end
      raise ArgumentError, "Invalid arguments when calling current_route()"
    end

### - (`Object`) fail(param_1 = nil)

Raises:

- (`ArgumentError`)

    81
    82
    83
    84
    85
    86
    87
    88
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 81

    def fail(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:fail, [Java::int.java_class]).call(param_1)
      elsif param_1.is_a?(Exception) && !block_given?
        return @j_del.java_method(:fail, [Java::JavaLang::Throwable.java_class]).call(::Vertx::Util::Utils.to_throwable(param_1))
      end
      raise ArgumentError, "Invalid arguments when calling fail(param_1)"
    end

### - (`Boolean`) failed?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    338
    339
    340
    341
    342
    343
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 338

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

### - (`Object`) failure

Raises:

- (`ArgumentError`)

    264
    265
    266
    267
    268
    269
    270
    271
    272
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 264

    def failure
      if !block_given?
        if @cached_failure != nil
          return @cached_failure
        end
        return @cached_failure = ::Vertx::Util::Utils.from_throwable(@j_del.java_method(:failure, []).call())
      end
      raise ArgumentError, "Invalid arguments when calling failure()"
    end

### - (`Object`) file_uploads

Raises:

- (`ArgumentError`)

    236
    237
    238
    239
    240
    241
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 236

    def file_uploads
      if !block_given?
        return ::Vertx::Util::Utils.to_set(@j_del.java_method(:fileUploads, []).call()).map! { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxWeb::FileUpload) }
      end
      raise ArgumentError, "Invalid arguments when calling file_uploads()"
    end

### - (`Object`) get(key = nil)

Raises:

- (`ArgumentError`)

    103
    104
    105
    106
    107
    108
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 103

    def get(key=nil)
      if key.class == String && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:get, [Java::java.lang.String.java_class]).call(key))
      end
      raise ArgumentError, "Invalid arguments when calling get(key)"
    end

### - (`Object`) get_acceptable_content_type

Raises:

- (`ArgumentError`)

    291
    292
    293
    294
    295
    296
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 291

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

### - (`Object`) get_body

Raises:

- (`ArgumentError`)

    229
    230
    231
    232
    233
    234
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 229

    def get_body
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getBody, []).call(),::Vertx::Buffer)
      end
      raise ArgumentError, "Invalid arguments when calling get_body()"
    end

### - (`Object`) get_body_as_json

Raises:

- (`ArgumentError`)

    215
    216
    217
    218
    219
    220
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 215

    def get_body_as_json
      if !block_given?
        return @j_del.java_method(:getBodyAsJson, []).call() != nil ? JSON.parse(@j_del.java_method(:getBodyAsJson, []).call().encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling get_body_as_json()"
    end

### - (`Object`) get_body_as_json_array

Raises:

- (`ArgumentError`)

    222
    223
    224
    225
    226
    227
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 222

    def get_body_as_json_array
      if !block_given?
        return @j_del.java_method(:getBodyAsJsonArray, []).call() != nil ? JSON.parse(@j_del.java_method(:getBodyAsJsonArray, []).call().encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling get_body_as_json_array()"
    end

### - (`Object`) get_body_as_string(encoding = nil)

Raises:

- (`ArgumentError`)

    206
    207
    208
    209
    210
    211
    212
    213
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 206

    def get_body_as_string(encoding=nil)
      if !block_given? && encoding == nil
        return @j_del.java_method(:getBodyAsString, []).call()
      elsif encoding.class == String && !block_given?
        return @j_del.java_method(:getBodyAsString, [Java::java.lang.String.java_class]).call(encoding)
      end
      raise ArgumentError, "Invalid arguments when calling get_body_as_string(encoding)"
    end

### - (`Object`) get_cookie(name = nil)

Raises:

- (`ArgumentError`)

    161
    162
    163
    164
    165
    166
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 161

    def get_cookie(name=nil)
      if name.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getCookie, [Java::java.lang.String.java_class]).call(name),::VertxWeb::Cookie)
      end
      raise ArgumentError, "Invalid arguments when calling get_cookie(name)"
    end

### - (`Object`) j_del

    36
    37
    38
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 36

    def j_del
      @j_del
    end

### - (`Object`) mount_point

Raises:

- (`ArgumentError`)

    126
    127
    128
    129
    130
    131
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 126

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

### - (`Object`) next

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) normalised_path

Raises:

- (`ArgumentError`)

    151
    152
    153
    154
    155
    156
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 151

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

### - (`Object`) path_param(name = nil)

Raises:

- (`ArgumentError`)

    441
    442
    443
    444
    445
    446
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 441

    def path_param(name=nil)
      if name.class == String && !block_given?
        return @j_del.java_method(:pathParam, [Java::java.lang.String.java_class]).call(name)
      end
      raise ArgumentError, "Invalid arguments when calling path_param(name)"
    end

### - (`Object`) path_params

Raises:

- (`ArgumentError`)

    432
    433
    434
    435
    436
    437
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 432

    def path_params
      if !block_given?
        return Java::IoVertxLangRuby::Helper.adaptingMap(@j_del.java_method(:pathParams, []).call(), Proc.new { |val| ::Vertx::Util::Utils.from_object(val) }, Proc.new { |val| ::Vertx::Util::Utils.to_string(val) })
      end
      raise ArgumentError, "Invalid arguments when calling path_params()"
    end

### - (`Object`) preferred_locale

Raises:

- (`ArgumentError`)

    424
    425
    426
    427
    428
    429
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 424

    def preferred_locale
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:preferredLocale, []).call(),::VertxWeb::Locale)
      end
      raise ArgumentError, "Invalid arguments when calling preferred_locale()"
    end

### - (`Object`) put(key = nil, obj = nil)

Raises:

- (`ArgumentError`)

    93
    94
    95
    96
    97
    98
    99
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 93

    def put(key=nil,obj=nil)
      if key.class == String && (obj.class == String  || obj.class == Hash || obj.class == Array || obj.class == NilClass || obj.class == TrueClass || obj.class == FalseClass || obj.class == Fixnum || obj.class == Float) && !block_given?
        @j_del.java_method(:put, [Java::java.lang.String.java_class,Java::java.lang.Object.java_class]).call(key,::Vertx::Util::Utils.to_object(obj))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling put(key,obj)"
    end

### - (`Object`) remove(key = nil)

Raises:

- (`ArgumentError`)

    112
    113
    114
    115
    116
    117
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 112

    def remove(key=nil)
      if key.class == String && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:remove, [Java::java.lang.String.java_class]).call(key))
      end
      raise ArgumentError, "Invalid arguments when calling remove(key)"
    end

### - (`Boolean`) remove_body_end_handler?(handlerID = nil)

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    331
    332
    333
    334
    335
    336
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 331

    def remove_body_end_handler?(handlerID=nil)
      if handlerID.class == Fixnum && !block_given?
        return @j_del.java_method(:removeBodyEndHandler, [Java::int.java_class]).call(handlerID)
      end
      raise ArgumentError, "Invalid arguments when calling remove_body_end_handler?(handlerID)"
    end

### - (`Object`) remove_cookie(name = nil)

Raises:

- (`ArgumentError`)

    182
    183
    184
    185
    186
    187
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 182

    def remove_cookie(name=nil)
      if name.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:removeCookie, [Java::java.lang.String.java_class]).call(name),::VertxWeb::Cookie)
      end
      raise ArgumentError, "Invalid arguments when calling remove_cookie(name)"
    end

### - (`Boolean`) remove_headers_end_handler?(handlerID = nil)

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    310
    311
    312
    313
    314
    315
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 310

    def remove_headers_end_handler?(handlerID=nil)
      if handlerID.class == Fixnum && !block_given?
        return @j_del.java_method(:removeHeadersEndHandler, [Java::int.java_class]).call(handlerID)
      end
      raise ArgumentError, "Invalid arguments when calling remove_headers_end_handler?(handlerID)"
    end

### - (`Object`) request

Raises:

- (`ArgumentError`)

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

    def request
      if !block_given?
        if @cached_request != nil
          return @cached_request
        end
        return @cached_request = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:request, []).call(),::Vertx::HttpServerRequest)
      end
      raise ArgumentError, "Invalid arguments when calling request()"
    end

### - (`Object`) reroute(param_1 = nil, param_2 = nil)

Raises:

- (`ArgumentError`)

    397
    398
    399
    400
    401
    402
    403
    404
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 397

    def reroute(param_1=nil,param_2=nil)
      if param_1.class == String && !block_given? && param_2 == nil
        return @j_del.java_method(:reroute, [Java::java.lang.String.java_class]).call(param_1)
      elsif param_1.class == Symbol && param_2.class == String && !block_given?
        return @j_del.java_method(:reroute, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1),param_2)
      end
      raise ArgumentError, "Invalid arguments when calling reroute(param_1,param_2)"
    end

### - (`Object`) response

Raises:

- (`ArgumentError`)

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

    def response
      if !block_given?
        if @cached_response != nil
          return @cached_response
        end
        return @cached_response = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:response, []).call(),::Vertx::HttpServerResponse)
      end
      raise ArgumentError, "Invalid arguments when calling response()"
    end

### - (`Object`) session

Raises:

- (`ArgumentError`)

    246
    247
    248
    249
    250
    251
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 246

    def session
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:session, []).call(),::VertxWeb::Session)
      end
      raise ArgumentError, "Invalid arguments when calling session()"
    end

### - (`Object`) set_acceptable_content_type(contentType = nil)

Raises:

- (`ArgumentError`)

    383
    384
    385
    386
    387
    388
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 383

    def set_acceptable_content_type(contentType=nil)
      if contentType.class == String && !block_given?
        return @j_del.java_method(:setAcceptableContentType, [Java::java.lang.String.java_class]).call(contentType)
      end
      raise ArgumentError, "Invalid arguments when calling set_acceptable_content_type(contentType)"
    end

### - (`Object`) set_body(body = nil)

Raises:

- (`ArgumentError`)

    347
    348
    349
    350
    351
    352
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 347

    def set_body(body=nil)
      if body.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:setBody, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(body.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling set_body(body)"
    end

### - (`Object`) set_session(session = nil)

Raises:

- (`ArgumentError`)

    356
    357
    358
    359
    360
    361
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 356

    def set_session(session=nil)
      if session.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:setSession, [Java::IoVertxExtWeb::Session.java_class]).call(session.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling set_session(session)"
    end

### - (`Object`) set_user(user = nil)

Raises:

- (`ArgumentError`)

    365
    366
    367
    368
    369
    370
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 365

    def set_user(user=nil)
      if user.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:setUser, [Java::IoVertxExtAuth::User.java_class]).call(user.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling set_user(user)"
    end

### - (`Object`) status_code

Raises:

- (`ArgumentError`)

    279
    280
    281
    282
    283
    284
    285
    286
    287
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 279

    def status_code
      if !block_given?
        if @cached_status_code != nil
          return @cached_status_code
        end
        return @cached_status_code = @j_del.java_method(:statusCode, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling status_code()"
    end

### - (`Object`) user

Raises:

- (`ArgumentError`)

    254
    255
    256
    257
    258
    259
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 254

    def user
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:user, []).call(),::VertxAuthCommon::User)
      end
      raise ArgumentError, "Invalid arguments when calling user()"
    end

### - (`Object`) vertx

Raises:

- (`ArgumentError`)

    119
    120
    121
    122
    123
    124
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/routing_context.rb', line 119

    def vertx
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:vertx, []).call(),::Vertx::Vertx)
      end
      raise ArgumentError, "Invalid arguments when calling vertx()"
    end