封鎖 >登錄檔 >getClass
Registry.getClass() 函式
取得指定名稱和類型的類別。
Signature:
export declare function getClass<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): (new (...p1: any[]) => T) | null;
參數
參數 |
類型 |
說明 |
類型 |
字串 |類型<T> |
外掛程式的類型。(例如欄位、轉譯器) |
名稱 |
字串 |
外掛程式的名稱。(例如:field_angle、geras) |
opt_throwIfMissing |
布林值 |
(選用) 找不到外掛程式時,是否要擲回錯誤。 |
傳回:
(最新 (...p1: any[]) => T) |空值
具有指定名稱和類型的類別;如果不存在,則為空值。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-22 (世界標準時間)。
[null,null,["上次更新時間:2024-08-22 (世界標準時間)。"],[[["The `registry.getClass()` function retrieves the class associated with a specific name and type from the Blockly registry."],["It requires the plugin's type (like 'Field' or 'Renderer') and name as input."],["An optional boolean parameter controls whether an error is thrown if the plugin is not found."],["The function returns the corresponding class if found, otherwise it returns null."]]],[]]