Class List Method List File List

# Class: VertxWeb::Router

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

## Class Method Summary (collapse)

- + (Object) router(vertx = nil)

## Instance Method Summary (collapse)

- - (Object) accept(request = nil)
- - (Object) clear
- - (Object) connect(path = nil)
- - (Object) connect_with_regex(regex = nil)
- - (Object) delete(path = nil)
- - (Object) delete_with_regex(regex = nil)
- - (Object) exception_handler
- - (Object) get(path = nil)
- - (Object) get_routes
- - (Object) get_with_regex(regex = nil)
- - (Object) handle_context(context = nil)
- - (Object) handle_failure(context = nil)
- - (Object) head(path = nil)
- - (Object) head_with_regex(regex = nil)
- - (Router) initialize(j_del) constructor
  A new instance of Router.
- - (Object) j_del
- - (Object) mount_sub_router(mountPoint = nil, subRouter = nil)
- - (Object) options(path = nil)
- - (Object) options_with_regex(regex = nil)
- - (Object) patch(path = nil)
- - (Object) patch_with_regex(regex = nil)
- - (Object) post(path = nil)
- - (Object) post_with_regex(regex = nil)
- - (Object) put(path = nil)
- - (Object) put_with_regex(regex = nil)
- - (Object) route(param_1 = nil, param_2 = nil)
- - (Object) route_with_regex(param_1 = nil, param_2 = nil)
- - (Object) trace(path = nil)
- - (Object) trace_with_regex(regex = nil)

## Constructor Details

### - (`Router`) initialize(j_del)

Returns a new instance of Router

    15
    16
    17
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 15

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) router(vertx = nil)

Raises:

- (`ArgumentError`)

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

    def self.router(vertx=nil)
      if vertx.class.method_defined?(:j_del) && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWeb::Router.java_method(:router, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxWeb::Router)
      end
      raise ArgumentError, "Invalid arguments when calling router(vertx)"
    end

## Instance Method Details

### - (`Object`) accept(request = nil)

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 37

    def accept(request=nil)
      if request.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:accept, [Java::IoVertxCoreHttp::HttpServerRequest.java_class]).call(request.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling accept(request)"
    end

### - (`Object`) clear

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) connect(path = nil)

Raises:

- (`ArgumentError`)

    219
    220
    221
    222
    223
    224
    225
    226
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 219

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

### - (`Object`) connect_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) delete(path = nil)

Raises:

- (`ArgumentError`)

    179
    180
    181
    182
    183
    184
    185
    186
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 179

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

### - (`Object`) delete_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) exception_handler

Raises:

- (`ArgumentError`)

    287
    288
    289
    290
    291
    292
    293
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 287

    def exception_handler
      if block_given?
        @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling exception_handler()"
    end

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

Raises:

- (`ArgumentError`)

    79
    80
    81
    82
    83
    84
    85
    86
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 79

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

### - (`Object`) get_routes

Raises:

- (`ArgumentError`)

    257
    258
    259
    260
    261
    262
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 257

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

### - (`Object`) get_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

    90
    91
    92
    93
    94
    95
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 90

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

### - (`Object`) handle_context(context = nil)

Raises:

- (`ArgumentError`)

    297
    298
    299
    300
    301
    302
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 297

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

### - (`Object`) handle_failure(context = nil)

Raises:

- (`ArgumentError`)

    306
    307
    308
    309
    310
    311
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 306

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

### - (`Object`) head(path = nil)

Raises:

- (`ArgumentError`)

    99
    100
    101
    102
    103
    104
    105
    106
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 99

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

### - (`Object`) head_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

    110
    111
    112
    113
    114
    115
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 110

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

### - (`Object`) j_del

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

    def j_del
      @j_del
    end

### - (`Object`) mount_sub_router(mountPoint = nil, subRouter = nil)

Raises:

- (`ArgumentError`)

    276
    277
    278
    279
    280
    281
    282
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 276

    def mount_sub_router(mountPoint=nil,subRouter=nil)
      if mountPoint.class == String && subRouter.class.method_defined?(:j_del) && !block_given?
        @j_del.java_method(:mountSubRouter, [Java::java.lang.String.java_class,Java::IoVertxExtWeb::Router.java_class]).call(mountPoint,subRouter.j_del)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling mount_sub_router(mountPoint,subRouter)"
    end

### - (`Object`) options(path = nil)

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) options_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

    130
    131
    132
    133
    134
    135
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 130

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

### - (`Object`) patch(path = nil)

Raises:

- (`ArgumentError`)

    239
    240
    241
    242
    243
    244
    245
    246
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 239

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

### - (`Object`) patch_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

    250
    251
    252
    253
    254
    255
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 250

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

### - (`Object`) post(path = nil)

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) post_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) put(path = nil)

Raises:

- (`ArgumentError`)

    139
    140
    141
    142
    143
    144
    145
    146
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 139

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

### - (`Object`) put_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

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

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

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

Raises:

- (`ArgumentError`)

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

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

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

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) trace(path = nil)

Raises:

- (`ArgumentError`)

    199
    200
    201
    202
    203
    204
    205
    206
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 199

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

### - (`Object`) trace_with_regex(regex = nil)

Raises:

- (`ArgumentError`)

    210
    211
    212
    213
    214
    215
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/router.rb', line 210

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