Object built-in object

Object Handler

Message processor interface

Inheritance

%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 processor chain processing object

1
new Handler(Array hdlrs);

Call parameters:

  • hdlrs : Array, processor array

Create a message processor routing object

1
new Handler(Object map);

Call parameters:

  • map : Object, initial routing parameters

Create a JavaSvript message processor

1
new Handler(Function hdlr);

Call parameters:

  • hdlr : Function, JavaScript processor function

Construct a fileHandler or HttpRepeater

1
new Handler(String hdlr);

Call parameters:

  • hdlr : String, address parameter of the processor

Member function

invoke

Handle a message or object

1
Handler Handler.invoke(object v) async;

Call parameters:

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

Return result:

  • Handler , return to the next processor

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be reimplemented according to its own characteristics

1
String Handler.toString();

Return result:

  • String , returns a string representation of the object

toJSON

Returns the JSON representation of the object, generally returns a collection of readable attributes defined by the object

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

Call parameters:

  • key : String, unused

Return result:

  • Value , returns a value containing JSON serializable