研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly > FieldTextInput > doClassValidation_
FieldTextInput.doClassValidation_() 方法
确保输入值会转换为有效字符串。
Signature:
protected doClassValidation_(newValue?: any): string | null;
参数
参数 |
类型 |
说明 |
newValue |
任意 |
(可选)输入值。 |
返回:
string | null
有效的字符串,如果无效则为 null。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-04。
[null,null,["最后更新时间 (UTC):2024-11-04。"],[[["The `doClassValidation_` method in `FieldTextInput` is used to validate user input, ensuring it can be cast to a string."],["It accepts an optional `newValue` parameter representing the input and returns a valid string if the input is valid, otherwise null."],["This method is designated as `protected`, indicating it is intended for internal use within the class or its subclasses."]]],["The `doClassValidation_` method, part of the `FieldTextInput` class, validates input values to ensure they can be cast to a string. It accepts an optional `newValue` of any type as input. The method returns either a valid string if the input is acceptable or `null` if the input is invalid. This method ensures the input is a usable string.\n"]]