blockly > registry > getObject
Funzione registry.getObject()
Ottiene l'oggetto per il nome e il tipo specificati.
Firma:
export declare function getObject<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): T | null;
Parametri
Parametro |
Tipo |
Descrizione |
tipo |
stringa | Tipo<T> |
Il tipo di plug-in. (ad es. Categoria) |
nome |
stringa |
Il nome del plug-in. (ad es. categoria logica). |
opt_throwIfMissing |
booleano |
(Facoltativo) Indica se generare o meno un errore se non riusciamo a trovare l'oggetto. |
Resi:
T | null
L'oggetto con il nome e il tipo specificati oppure nullo se non ne esiste nessuno.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-09-12 UTC.
[null,null,["Ultimo aggiornamento 2024-09-12 UTC."],[[["The `registry.getObject()` function retrieves an object from Blockly's registry based on its type and name."],["It accepts the object's type, name, and an optional flag to throw an error if the object is not found."],["The function returns the requested object if found, otherwise it returns null."]]],[]]