Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
blockly > kayıt otoritesi > getObject
registry.getObject() işlevi
Verilen ad ve tür için nesneyi alır.
İmza:
export declare function getObject<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): T | null;
Parametreler
Parametre |
Tür |
Açıklama |
tür |
dize | Tür<T> |
Eklentinin türü. (ör. Kategori) |
ad |
dize |
Eklentinin adı. (Ör. mantık_kategorisi) |
opt_throwIfMissing |
boolean |
(İsteğe bağlı) Nesneyi bulamamamız durumunda hata bildirilip bildirilmeyeceğini belirler. |
Şunu döndürür:
Tr | boş
Belirtilen ada ve türe sahip nesne veya yoksa null.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-25 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-25 UTC."],[],["The `registry.getObject()` function retrieves a registered object based on its type and name. It accepts a `type` (string or Type), `name` (string), and an optional `opt_throwIfMissing` (boolean) parameter. If the object is found, it is returned; otherwise, it returns `null` or throws an error if `opt_throwIfMissing` is set to `true`. The `type` specifies the plugin type (e.g., \"Category\"), and `name` is the plugin's identifier (e.g., \"logic_category\").\n"]]