コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >fieldRegistry >登録
fieldRegistry.register() 関数
フィールド型を登録します。fieldRegistry.fromJson はこのレジストリを使用して、適切なフィールド型を検索します。
署名:
export declare function register(type: string, fieldClass: RegistrableField): void;
パラメータ
パラメータ |
型 |
説明 |
type |
文字列 |
JSON 定義で使用されるフィールド型名。 |
fieldClass |
RegistrableField |
フィールドのインスタンスを構築できる fromJson 関数を含むフィールド クラス。 |
戻り値:
void
例外
{エラー}: 型名が空か、フィールドがすでに登録されているか、fieldClass が fromJson 関数を含むオブジェクトでない場合。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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 `fieldRegistry.register()` function registers a field type for use with `fieldRegistry.fromJson`. It takes two parameters: `type` (a string representing the field type name) and `fieldClass` (a class with a `fromJson` function for constructing field instances). It returns void. The function throws an error if the type is empty, the field is already registered, or the class is invalid. It enables the system to find the appropriate field type during JSON parsing.\n"]]