javax.swing.text.DateFormatter.stringToValue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(102)

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

DateFormatter.stringToValue介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-team-commons

@Override
  public Object stringToValue (String text) throws java.text.ParseException {
    if (text == null || text.trim().isEmpty()) {
      return null;
    }
    return super.stringToValue(text);
  }
};

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-bugtracking

@Override
public Object stringToValue (String text) throws ParseException {
  if (text == null || text.isEmpty()) {
    return null;
  } else {
    Date date = (Date) super.stringToValue(text);
    return new IssueScheduleInfo(date);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-team-commons

@Override
public Date getDate () {
  try {
    return (Date) formatter.stringToValue(getText());
  } catch (ParseException ex) {
    Support.LOG.log(Level.INFO, null, ex);
    return null;
  }
}

代码示例来源:origin: com.jgoodies/validation

/**
 * Returns the <code>Object</code> representation of the
 * <code>String</code> <code>text</code>.<p>
 *
 * Unlike its superclass, this class converts blank strings
 * to the empty value.
 *
 * @param text <code>String</code> to convert
 * @return <code>Object</code> representation of text
 * @throws ParseException if there is an error in the conversion
 */
@Override
public Object stringToValue(String text) throws ParseException {
  return ValidationUtils.isBlank(text)
    ? emptyValue
    : super.stringToValue(text);
}

代码示例来源:origin: com.eas.platypus/platypus-js-calendar-widget

} else {
  try {
    Object value = super.stringToValue(text);
    if (super.valueToString(value).trim().length() != text.trim().length()) {
      throw new ParseException(text, text.length() - 1);
        try {
          String complementedText = text.substring(0, text.length() - DATETIME_FORMAT_TAIL.length()) + "00:00:00";
          Object value = super.stringToValue(complementedText);
          if (!super.valueToString(value).equals(complementedText)) {
            throw new ParseException(complementedText, complementedText.length() - 1);

相关文章