Object built-in object

ObjectHandler

Message handler interface

inheritance relationship

%0 object object toString() toJSON() Handler Handler new Handler() invoke() object->Handler Chain Chain Handler->Chain HttpHandler HttpHandler Handler->HttpHandler HttpRepeater HttpRepeater Handler->HttpRepeater Routing Routing Handler->Routing SslHandler SslHandler Handler->SslHandler

Constructor

Handler

Construct a message handler chain processing object

1
new Handler(Array hdlrs);

Call parameters:

  • hdlrs: Array, processor array

Create a message handler routing object

1
new Handler(Object map);

Call parameters:

  • map: Object, initialization routing parameters

Create a JavaScript message handler

1
new Handler(Function hdlr);

Call parameters:

  • hdlr: Function, JavaScript processor function

Construct a fileHandler orHttpRepeater

1
new Handler(String hdlr);

Call parameters:

  • hdlr: String, address parameter of the processor

member function

invoke

Process a message or object

1
Handler Handler.invoke(object v) async;

Call parameters:

  • v:object, specify the message or object to be processed

Return results:

  • Handler, return to the next processor

toString

Returns the string representation of the object. Generally, "[Native Object]" is returned. The object can be re-implemented according to its own characteristics.

1
String Handler.toString();

Return results:

  • String, returns the string representation of the object

toJSON

Returns a JSON format representation of the object, generally returning a collection of readable properties defined by the object.

1
Value Handler.toJSON(String key = "");

Call parameters:

  • key: String, not used

Return results:

  • Value, returns a value containing JSON serializable