nsIJSID 编辑

js/src/xpconnect/idl/xpcjsid.idlScriptable This interface provides information about a contract or interface. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3)

The following methods return objects that implement this interface:

Components.interfaces.name
Components.classes[contract]
Components.interfacesById[uuid]
Components.classesById[cid]

The first two cases create a named JSID while the last two cases create an unnamed JSID. An unnamed JSID also results when you implement a function that is passed an nsIIDRefparameter, such as QueryInterface(). Note that for these cases of JSID the specified class or interface must exist and be scriptable.

Method overview

boolean equals(in nsIJSID other);
const nsID* getID(); Violates the XPCOM interface guidelines
void initialize(in string idString);
string toString();

Attributes

AttributeTypeDescription
idnsIDPtrRead only. Native code only! Obsolete since Gecko 1.9 The internal nsID.
namestringRead only. The name of the JSID, if it was set.
numberstringRead only. The string representation of the internal nsID.
validbooleanRead only. Returns true if the JSID has been initialised.

Methods

equals()

This method determines if this nsIJSID has the same nsID as another nsIJSID.

boolean equals(
  in nsIJSID other
);
Parameters
other
The other nsIJSID to compare to.
Return value

true if the nsIJSID's are valid and have the same nsID, otherwise false.

Violates the XPCOM interface guidelines

getID()

const nsID* getID();
Parameters

None.

Return value

A pointer to the internal nsID structure.

initialize()

Initializes the JSID.

void initialize(
  in string idString
);
Parameters
idString
The number to initialize the JSID, in string format, e.g. {00000000-0000-0000-c000-000000000046}. A JSID can only be initialized once.

toString()

This methods returns a string representation of the object.

string toString();
Parameters

None.

Return value

The name of the JSID if it has one, otherwise the string representation of its nsID.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:127 次

字数:4601

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文