จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
blockly > รีจิสทรี > getObject
ฟังก์ชันรีจิสทรี.getObject()
รับออบเจ็กต์สำหรับชื่อและประเภทที่ระบุ
ลายเซ็น:
export declare function getObject<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): T | null;
พารามิเตอร์
พารามิเตอร์ |
ประเภท |
คำอธิบาย |
ประเภท |
สตริง | ประเภท<T> |
ประเภทของปลั๊กอิน (เช่น หมวดหมู่) |
ชื่อ |
สตริง |
ชื่อปลั๊กอิน (เช่น Logic_category) |
opt_throwIfMissing |
boolean |
(ไม่บังคับ) แสดงข้อผิดพลาดหรือไม่หากเราไม่พบออบเจ็กต์ |
การคืนสินค้า:
ที | ค่าว่าง
ออบเจ็กต์ที่มีชื่อและประเภทที่ระบุหรือค่าว่าง ถ้าไม่มี
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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"]]