Class: Method

Method

Reflected service method.

new Method(name, type, requestType, responseType, requestStream, responseStream, options)

Constructs a new service method instance.

Name Type Description
name string

Method name

type string | undefined

Method type, usually "rpc"

requestType string

Request message type

responseType string

Response message type

requestStream boolean | Object.<string, *> optional

Whether the request is streamed

responseStream boolean | Object.<string, *> optional

Whether the response is streamed

options Object.<string, *> optional

Declared options

Extends

Members

comment { string | null }

Comment text, if any.

filename { string | null }

Defining file name.

fullName readonly{ string }

Full name including leading dot.

name { string }

Unique name within its namespace.

options { Object<string, *> | undefined }

Options.

parent { Namespace | null }

Parent namespace.

requestStream { boolean | undefined }

Whether requests are streamed or not.

requestType { string }

Request type.

resolved { boolean }

Whether already resolved or not.

resolvedRequestType { Type | null }

Resolved request type.

resolvedResponseType { Type | null }

Resolved response type.

responseStream { boolean | undefined }

Whether responses are streamed or not.

responseType { string }

Response type.

root readonly{ Root }

Reference to the root namespace.

type { string }

Method type.

Methods

Method.fromJSON(name, json){ Method }

Constructs a method from a method descriptor.

Name Type Description
name string

Method name

json IMethod

Method descriptor

Throws:
Type Description
TypeError

If arguments are invalid

Returns:
Type Description
Method Created method

inherited getOption(name){ * }

Gets an option value.

Name Type Description
name string

Option name

Returns:
Type Description
* Option value or undefined if not set

inherited onAdd(parent){ undefined }

Called when this object is added to a parent.

Name Type Description
parent ReflectionObject

Parent added to

Returns:
Type Description
undefined

inherited onRemove(parent){ undefined }

Called when this object is removed from a parent.

Name Type Description
parent ReflectionObject

Parent removed from

Returns:
Type Description
undefined

Resolves this objects type references.

Returns:
Type Description
ReflectionObject this

inherited setOption(name, value, ifNotSet){ ReflectionObject }

Sets an option.

Name Type Description
name string

Option name

value *

Option value

ifNotSet boolean optional

Sets the option only if it isn't currently set

Returns:
Type Description
ReflectionObject this

inherited setOptions(options, ifNotSet){ ReflectionObject }

Sets multiple options.

Name Type Description
options Object.<string, *>

Options to set

ifNotSet boolean optional

Sets an option only if it isn't currently set

Returns:
Type Description
ReflectionObject this

Converts this method to a method descriptor.

Returns:
Type Description
IMethod Method descriptor

inherited toString(){ string }

Converts this instance to its string representation.

Returns:
Type Description
string Class name[, space, full name]