java.text.SimpleDateFormat.validatePattern()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中java.text.SimpleDateFormat.validatePattern()方法的一些代码示例,展示了SimpleDateFormat.validatePattern()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimpleDateFormat.validatePattern()方法的具体详情如下:
包路径:java.text.SimpleDateFormat
类名称:SimpleDateFormat
方法名:validatePattern

SimpleDateFormat.validatePattern介绍

[英]Validates the pattern.
[中]验证模式。

代码示例

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Changes the pattern of this simple date format to the specified pattern
  3. * which uses non-localized pattern characters.
  4. *
  5. * @param template
  6. * the non-localized pattern.
  7. * @throws NullPointerException
  8. * if the pattern is {@code null}.
  9. * @throws IllegalArgumentException
  10. * if the pattern is invalid.
  11. */
  12. public void applyPattern(String template) {
  13. validatePattern(template);
  14. pattern = template;
  15. }

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and the {@code DateFormatSymbols} and {@code
  4. * Calendar} for the specified locale.
  5. *
  6. * @param template
  7. * the pattern.
  8. * @param locale
  9. * the locale.
  10. * @throws NullPointerException
  11. * if the pattern is {@code null}.
  12. * @throws IllegalArgumentException
  13. * if the pattern is invalid.
  14. */
  15. public SimpleDateFormat(String template, Locale locale) {
  16. this(locale);
  17. validatePattern(template);
  18. pattern = template;
  19. formatData = new DateFormatSymbols(locale);
  20. }

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and {@code DateFormatSymbols} and the {@code
  4. * Calendar} for the user's default locale.
  5. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  6. *
  7. * @param template
  8. * the pattern.
  9. * @param value
  10. * the DateFormatSymbols.
  11. * @throws NullPointerException
  12. * if the pattern is {@code null}.
  13. * @throws IllegalArgumentException
  14. * if the pattern is invalid.
  15. */
  16. public SimpleDateFormat(String template, DateFormatSymbols value) {
  17. this(Locale.getDefault());
  18. validatePattern(template);
  19. pattern = template;
  20. formatData = (DateFormatSymbols) value.clone();
  21. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Changes the pattern of this simple date format to the specified pattern
  3. * which uses non-localized pattern characters.
  4. *
  5. * @param template
  6. * the non-localized pattern.
  7. * @throws NullPointerException
  8. * if the pattern is {@code null}.
  9. * @throws IllegalArgumentException
  10. * if the pattern is invalid.
  11. */
  12. public void applyPattern(String template) {
  13. validatePattern(template);
  14. pattern = template;
  15. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Changes the pattern of this simple date format to the specified pattern
  3. * which uses non-localized pattern characters.
  4. *
  5. * @param template
  6. * the non-localized pattern.
  7. * @throws NullPointerException
  8. * if the pattern is {@code null}.
  9. * @throws IllegalArgumentException
  10. * if the pattern is invalid.
  11. */
  12. public void applyPattern(String template) {
  13. validatePattern(template);
  14. pattern = template;
  15. }

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Changes the pattern of this simple date format to the specified pattern
  3. * which uses non-localized pattern characters.
  4. *
  5. * @param template
  6. * the non-localized pattern.
  7. * @throws NullPointerException
  8. * if the pattern is {@code null}.
  9. * @throws IllegalArgumentException
  10. * if the pattern is invalid.
  11. */
  12. public void applyPattern(String template) {
  13. validatePattern(template);
  14. pattern = template;
  15. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Changes the pattern of this simple date format to the specified pattern
  3. * which uses non-localized pattern characters.
  4. *
  5. * @param template
  6. * the non-localized pattern.
  7. * @throws NullPointerException
  8. * if the pattern is {@code null}.
  9. * @throws IllegalArgumentException
  10. * if the pattern is invalid.
  11. */
  12. public void applyPattern(String template) {
  13. validatePattern(template);
  14. pattern = template;
  15. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Changes the pattern of this simple date format to the specified pattern
  3. * which uses non-localized pattern characters.
  4. *
  5. * @param template
  6. * the non-localized pattern.
  7. * @throws NullPointerException
  8. * if the pattern is {@code null}.
  9. * @throws IllegalArgumentException
  10. * if the pattern is invalid.
  11. */
  12. public void applyPattern(String template) {
  13. validatePattern(template);
  14. pattern = template;
  15. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Changes the pattern of this simple date format to the specified pattern
  3. * which uses non-localized pattern characters.
  4. *
  5. * @param template
  6. * the non-localized pattern.
  7. * @throws NullPointerException
  8. * if the pattern is {@code null}.
  9. * @throws IllegalArgumentException
  10. * if the pattern is invalid.
  11. */
  12. public void applyPattern(String template) {
  13. validatePattern(template);
  14. pattern = template;
  15. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and the {@code DateFormatSymbols} and {@code
  4. * Calendar} for the specified locale.
  5. *
  6. * @param template
  7. * the pattern.
  8. * @param locale
  9. * the locale.
  10. * @throws NullPointerException
  11. * if the pattern is {@code null}.
  12. * @throws IllegalArgumentException
  13. * if the pattern is invalid.
  14. */
  15. public SimpleDateFormat(String template, Locale locale) {
  16. this(locale);
  17. validatePattern(template);
  18. pattern = template;
  19. formatData = new DateFormatSymbols(locale);
  20. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and the {@code DateFormatSymbols} and {@code
  4. * Calendar} for the specified locale.
  5. *
  6. * @param template
  7. * the pattern.
  8. * @param locale
  9. * the locale.
  10. * @throws NullPointerException
  11. * if the pattern is {@code null}.
  12. * @throws IllegalArgumentException
  13. * if the pattern is invalid.
  14. */
  15. public SimpleDateFormat(String template, Locale locale) {
  16. this(locale);
  17. validatePattern(template);
  18. pattern = template;
  19. formatData = new DateFormatSymbols(locale);
  20. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and the {@code DateFormatSymbols} and {@code
  4. * Calendar} for the specified locale.
  5. *
  6. * @param template
  7. * the pattern.
  8. * @param locale
  9. * the locale.
  10. * @throws NullPointerException
  11. * if the pattern is {@code null}.
  12. * @throws IllegalArgumentException
  13. * if the pattern is invalid.
  14. */
  15. public SimpleDateFormat(String template, Locale locale) {
  16. this(locale);
  17. validatePattern(template);
  18. pattern = template;
  19. formatData = new DateFormatSymbols(locale);
  20. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and the {@code DateFormatSymbols} and {@code
  4. * Calendar} for the specified locale.
  5. *
  6. * @param template
  7. * the pattern.
  8. * @param locale
  9. * the locale.
  10. * @throws NullPointerException
  11. * if the pattern is {@code null}.
  12. * @throws IllegalArgumentException
  13. * if the pattern is invalid.
  14. */
  15. public SimpleDateFormat(String template, Locale locale) {
  16. this(locale);
  17. validatePattern(template);
  18. pattern = template;
  19. formatData = new DateFormatSymbols(locale);
  20. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and the {@code DateFormatSymbols} and {@code
  4. * Calendar} for the specified locale.
  5. *
  6. * @param template
  7. * the pattern.
  8. * @param locale
  9. * the locale.
  10. * @throws NullPointerException
  11. * if the pattern is {@code null}.
  12. * @throws IllegalArgumentException
  13. * if the pattern is invalid.
  14. */
  15. public SimpleDateFormat(String template, Locale locale) {
  16. this(locale);
  17. validatePattern(template);
  18. pattern = template;
  19. formatData = new DateFormatSymbols(locale);
  20. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and {@code DateFormatSymbols} and the {@code
  4. * Calendar} for the user's default locale.
  5. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  6. *
  7. * @param template
  8. * the pattern.
  9. * @param value
  10. * the DateFormatSymbols.
  11. * @throws NullPointerException
  12. * if the pattern is {@code null}.
  13. * @throws IllegalArgumentException
  14. * if the pattern is invalid.
  15. */
  16. public SimpleDateFormat(String template, DateFormatSymbols value) {
  17. this(Locale.getDefault());
  18. validatePattern(template);
  19. pattern = template;
  20. formatData = (DateFormatSymbols) value.clone();
  21. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and {@code DateFormatSymbols} and the {@code
  4. * Calendar} for the user's default locale.
  5. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  6. *
  7. * @param template
  8. * the pattern.
  9. * @param value
  10. * the DateFormatSymbols.
  11. * @throws NullPointerException
  12. * if the pattern is {@code null}.
  13. * @throws IllegalArgumentException
  14. * if the pattern is invalid.
  15. */
  16. public SimpleDateFormat(String template, DateFormatSymbols value) {
  17. this(Locale.getDefault());
  18. validatePattern(template);
  19. pattern = template;
  20. formatData = (DateFormatSymbols) value.clone();
  21. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and {@code DateFormatSymbols} and the {@code
  4. * Calendar} for the user's default locale.
  5. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  6. *
  7. * @param template
  8. * the pattern.
  9. * @param value
  10. * the DateFormatSymbols.
  11. * @throws NullPointerException
  12. * if the pattern is {@code null}.
  13. * @throws IllegalArgumentException
  14. * if the pattern is invalid.
  15. */
  16. public SimpleDateFormat(String template, DateFormatSymbols value) {
  17. this(Locale.getDefault());
  18. validatePattern(template);
  19. pattern = template;
  20. formatData = (DateFormatSymbols) value.clone();
  21. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and {@code DateFormatSymbols} and the {@code
  4. * Calendar} for the user's default locale.
  5. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  6. *
  7. * @param template
  8. * the pattern.
  9. * @param value
  10. * the DateFormatSymbols.
  11. * @throws NullPointerException
  12. * if the pattern is {@code null}.
  13. * @throws IllegalArgumentException
  14. * if the pattern is invalid.
  15. */
  16. public SimpleDateFormat(String template, DateFormatSymbols value) {
  17. this(Locale.getDefault());
  18. validatePattern(template);
  19. pattern = template;
  20. formatData = (DateFormatSymbols) value.clone();
  21. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and {@code DateFormatSymbols} and the {@code
  4. * Calendar} for the user's default locale.
  5. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  6. *
  7. * @param template
  8. * the pattern.
  9. * @param value
  10. * the DateFormatSymbols.
  11. * @throws NullPointerException
  12. * if the pattern is {@code null}.
  13. * @throws IllegalArgumentException
  14. * if the pattern is invalid.
  15. */
  16. public SimpleDateFormat(String template, DateFormatSymbols value) {
  17. this(Locale.getDefault());
  18. validatePattern(template);
  19. pattern = template;
  20. formatData = (DateFormatSymbols) value.clone();
  21. }

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Constructs a new {@code SimpleDateFormat} using the specified
  3. * non-localized pattern and {@code DateFormatSymbols} and the {@code
  4. * Calendar} for the user's default locale.
  5. * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
  6. *
  7. * @param template
  8. * the pattern.
  9. * @param value
  10. * the DateFormatSymbols.
  11. * @throws NullPointerException
  12. * if the pattern is {@code null}.
  13. * @throws IllegalArgumentException
  14. * if the pattern is invalid.
  15. */
  16. public SimpleDateFormat(String template, DateFormatSymbols value) {
  17. this(Locale.getDefault());
  18. validatePattern(template);
  19. pattern = template;
  20. formatData = (DateFormatSymbols) value.clone();
  21. }

相关文章

SimpleDateFormat类方法