調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
blockly > FieldVariable > getValidator
FieldVariable.getValidator() メソッド
このフィールドの検証関数を取得します。設定されていない場合は null を返します。変数が設定されていない場合は null を返します。最初の setValue 呼び出しではバリデータは実行されません。その時点ではフィールドがブロックとワークスペースに接続されていないためです。
署名:
getValidator(): FieldVariableValidator | null;
戻り値:
FieldVariableValidator | null
検証関数、または null。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-11-09 UTC。
[null,null,["最終更新日 2024-11-09 UTC。"],[[["The `getValidator()` method retrieves the validation function associated with a FieldVariable, which determines if a variable assignment is valid."],["It returns `null` if the variable isn't set or if the validation function hasn't been assigned, preventing validation during initial value setting."],["The returned validation function, if present, is of the `FieldVariableValidator` type and will be executed when variable assignments occur."]]],[]]