Interface TextField

All Superinterfaces:
FormField

public non-sealed interface TextField extends FormField
Text Form Field 文本表单字段

Features | 主要功能:

  • Maximum length constraint - 最大长度约束
  • Multiline and password field support - 多行和密码字段支持
  • Text alignment configuration - 文本对齐配置

Usage Examples | 使用示例:

TextField field = (TextField) form.getField("address");
field.setValue("123 Main Street");
boolean multiline = field.isMultiline();
int maxLen = field.getMaxLength();

Security | 安全性:

  • Thread-safe: Depends on implementation - 线程安全: 取决于实现
  • Null-safe: Depends on implementation - 空值安全: 取决于实现
Since:
JDK 25, opencode-base-pdf V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • getType

      default FormField.FieldType getType()
      Description copied from interface: FormField
      Gets field type 获取字段类型
      Specified by:
      getType in interface FormField
      Returns:
      field type | 字段类型
    • getMaxLength

      int getMaxLength()
      Gets maximum length 获取最大长度
      Returns:
      max length, or -1 if unlimited | 最大长度,无限制则返回 -1
    • isMultiline

      boolean isMultiline()
      Checks if multiline 检查是否多行
      Returns:
      true if multiline | 如果多行返回 true
    • isPassword

      boolean isPassword()
      Checks if password field 检查是否密码字段
      Returns:
      true if password | 如果是密码字段返回 true
    • getAlignment

      int getAlignment()
      Gets text alignment 获取文本对齐
      Returns:
      alignment (0=left, 1=center, 2=right) | 对齐方式