Object built-in object

Object Handler

Message processor interface

Inheritance

#lineWidth: 1.5 #font: Helvetica,sans-Serif #fontSize: 10 #leading: 1.6 #.this: fill=lightgray #.class: fill=white [<class>object|toString();toJSON()] [<this>Handler|new Handler()|invoke()] [<class>Chain] [<class>HttpHandler] [<class>HttpRepeater] [<class>Routing] [<class>SslHandler] [object] <:- [Handler] [Handler] <:- [Chain] [Handler] <:- [HttpHandler] [Handler] <:- [HttpRepeater] [Handler] <:- [Routing] [Handler] <:- [SslHandler] Handler new Handler() invoke() object toString() toJSON() Chain HttpHandler HttpRepeater Routing SslHandler

Constructor

Handler

Construct a message processor 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, initialize 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, the 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 result:

  • Handler, Return to the next processor

toString

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

1
String Handler.toString();

Return result:

  • String, Returns the string representation of the object

toJSON

Returns the JSON format 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