Object 内置对象

对象 object

基础对象,所有对象均继承于此

继承关系

#lineWidth: 1.5 #font: Helvetica,sans-Serif #fontSize: 10 #leading: 1.6 #.this: fill=lightgray #.class: fill=white [<this>object|toString();toJSON()] [<class>Buffer] [<class>Cipher] [<class>DbConnection] [<class>MySQL] [<class>Odbc] [<class>SQLite] [<class>Digest] [<class>EventEmitter] [<class>ChildProcess] [<class>DgramSocket] [<class>FSWatcher] [<class>LruCache] [<class>Service] [<class>StatsWatcher] [<class>WebSocket] [<class>WebView] [<class>Worker] [<class>Fiber] [<class>Handler] [<class>Chain] [<class>HttpHandler] [<class>HttpRepeater] [<class>Routing] [<class>SslHandler] [<class>HeapGraphEdge] [<class>HeapGraphNode] [<class>HeapSnapshot] [<class>HttpClient] [<class>HttpCollection] [<class>HttpCookie] [<class>HttpUploadData] [<class>Image] [<class>Iterator] [<class>LevelDB] [<class>Lock] [<class>Condition] [<class>Event] [<class>Semaphore] [<class>Message] [<class>HttpMessage] [<class>HttpRequest] [<class>HttpResponse] [<class>WebSocketMessage] [<class>MongoCollection] [<class>MongoCursor] [<class>MongoDB] [<class>MongoID] [<class>PKey] [<class>Redis] [<class>RedisHash] [<class>RedisList] [<class>RedisSet] [<class>RedisSortedSet] [<class>SandBox] [<class>Smtp] [<class>Stat] [<class>Stream] [<class>BufferedStream] [<class>SeekableStream] [<class>File] [<class>MemoryStream] [<class>RangeStream] [<class>Socket] [<class>SslSocket] [<class>TTYInputStream] [<class>TTYOutputStream] [<class>StringDecoder] [<class>TcpServer] [<class>HttpServer] [<class>HttpsServer] [<class>SslServer] [<class>Timer] [<class>UrlObject] [<class>X509Cert] [<class>X509Crl] [<class>X509Req] [<class>XmlAttr] [<class>XmlNamedNodeMap] [<class>XmlNode] [<class>XmlCharacterData] [<class>XmlComment] [<class>XmlText] [<class>XmlCDATASection] [<class>XmlDocument] [<class>XmlDocumentType] [<class>XmlElement] [<class>XmlProcessingInstruction] [<class>XmlNodeList] [<class>ZipFile] [object] <:- [Buffer] [object] <:- [Cipher] [object] <:- [DbConnection] [DbConnection] <:- [MySQL] [DbConnection] <:- [Odbc] [DbConnection] <:- [SQLite] [object] <:- [Digest] [object] <:- [EventEmitter] [EventEmitter] <:- [ChildProcess] [EventEmitter] <:- [DgramSocket] [EventEmitter] <:- [FSWatcher] [EventEmitter] <:- [LruCache] [EventEmitter] <:- [Service] [EventEmitter] <:- [StatsWatcher] [EventEmitter] <:- [WebSocket] [EventEmitter] <:- [WebView] [EventEmitter] <:- [Worker] [object] <:- [Fiber] [object] <:- [Handler] [Handler] <:- [Chain] [Handler] <:- [HttpHandler] [Handler] <:- [HttpRepeater] [Handler] <:- [Routing] [Handler] <:- [SslHandler] [object] <:- [HeapGraphEdge] [object] <:- [HeapGraphNode] [object] <:- [HeapSnapshot] [object] <:- [HttpClient] [object] <:- [HttpCollection] [object] <:- [HttpCookie] [object] <:- [HttpUploadData] [object] <:- [Image] [object] <:- [Iterator] [object] <:- [LevelDB] [object] <:- [Lock] [Lock] <:- [Condition] [Lock] <:- [Event] [Lock] <:- [Semaphore] [object] <:- [Message] [Message] <:- [HttpMessage] [HttpMessage] <:- [HttpRequest] [HttpMessage] <:- [HttpResponse] [Message] <:- [WebSocketMessage] [object] <:- [MongoCollection] [object] <:- [MongoCursor] [object] <:- [MongoDB] [object] <:- [MongoID] [object] <:- [PKey] [object] <:- [Redis] [object] <:- [RedisHash] [object] <:- [RedisList] [object] <:- [RedisSet] [object] <:- [RedisSortedSet] [object] <:- [SandBox] [object] <:- [Smtp] [object] <:- [Stat] [object] <:- [Stream] [Stream] <:- [BufferedStream] [Stream] <:- [SeekableStream] [SeekableStream] <:- [File] [SeekableStream] <:- [MemoryStream] [SeekableStream] <:- [RangeStream] [Stream] <:- [Socket] [Stream] <:- [SslSocket] [Stream] <:- [TTYInputStream] [Stream] <:- [TTYOutputStream] [object] <:- [StringDecoder] [object] <:- [TcpServer] [TcpServer] <:- [HttpServer] [HttpServer] <:- [HttpsServer] [TcpServer] <:- [SslServer] [object] <:- [Timer] [object] <:- [UrlObject] [object] <:- [X509Cert] [object] <:- [X509Crl] [object] <:- [X509Req] [object] <:- [XmlAttr] [object] <:- [XmlNamedNodeMap] [object] <:- [XmlNode] [XmlNode] <:- [XmlCharacterData] [XmlCharacterData] <:- [XmlComment] [XmlCharacterData] <:- [XmlText] [XmlText] <:- [XmlCDATASection] [XmlNode] <:- [XmlDocument] [XmlNode] <:- [XmlDocumentType] [XmlNode] <:- [XmlElement] [XmlNode] <:- [XmlProcessingInstruction] [object] <:- [XmlNodeList] [object] <:- [ZipFile] object toString() toJSON() Buffer Cipher DbConnection MySQL Odbc SQLite Digest EventEmitter ChildProcess DgramSocket FSWatcher LruCache Service StatsWatcher WebSocket WebView Worker Fiber Handler Chain HttpHandler HttpRepeater Routing SslHandler HeapGraphEdge HeapGraphNode HeapSnapshot HttpClient HttpCollection HttpCookie HttpUploadData Image Iterator LevelDB Lock Condition Event Semaphore Message HttpMessage HttpRequest HttpResponse WebSocketMessage MongoCollection MongoCursor MongoDB MongoID PKey Redis RedisHash RedisList RedisSet RedisSortedSet SandBox Smtp Stat Stream BufferedStream SeekableStream File MemoryStream RangeStream Socket SslSocket TTYInputStream TTYOutputStream StringDecoder TcpServer HttpServer HttpsServer SslServer Timer UrlObject X509Cert X509Crl X509Req XmlAttr XmlNamedNodeMap XmlNode XmlCharacterData XmlComment XmlText XmlCDATASection XmlDocument XmlDocumentType XmlElement XmlProcessingInstruction XmlNodeList ZipFile

成员函数

toString

返回对象的字符串表示,一般返回 "[Native Object]",对象可以根据自己的特性重新实现

1
String object.toString();

返回结果:

  • String, 返回对象的字符串表示

toJSON

返回对象的 JSON 格式表示,一般返回对象定义的可读属性集合

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

调用参数:

  • key: String, 未使用

返回结果:

  • Value, 返回包含可 JSON 序列化的值