模块 java.base
 java.util

类 IllformedLocaleException

所有已实现的接口:
Serializable

public class IllformedLocaleException extends RuntimeException
Locale Locale.Builder 中的方法抛出以指示参数不是格式正确的 BCP 47 标记。
自从:
1.7
参见:
  • 构造方法详细信息

    • IllformedLocaleException

      public IllformedLocaleException()
      构造一个新的 IllformedLocaleException,没有详细消息,-1 作为错误索引。
    • IllformedLocaleException

      public IllformedLocaleException(String  message)
      使用给定的消息和 -1 作为错误索引构造一个新的 IllformedLocaleException
      参数:
      message - 消息
    • IllformedLocaleException

      public IllformedLocaleException(String  message, int errorIndex)
      使用给定的消息和错误索引构造一个新的 IllformedLocaleException。错误索引是从格式错误的值的开始到解析首次检测到错误的位置的近似偏移量。负错误索引值表示错误索引不适用或未知。
      参数:
      message - 消息
      errorIndex - 索引
  • 方法详情

    • getErrorIndex

      public int getErrorIndex()
      返回发现错误的索引。负值表示错误索引不适用或未知。
      返回:
      错误指数