⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 booleaneditor.java

📁 webwork source
💻 JAVA
字号:
/*
 * WebWork, Web Application Framework
 *
 * Distributable under Apache license.
 * See terms of license at opensource.org
 */
package webwork.util.editor;

import webwork.action.ValidationEditorSupport;

/**
 *	@see java.beans.PropertyEditorSupport
 *	@see ValidationEditorSupport
 *	@see FastPropertyEditor
 *	@see PropertyEditorException
 *	@author Matt Baldree (matt@smallleap.com)
 *	@version $Revision: 1.4 $
 */
public class BooleanEditor extends ValidationEditorSupport implements FastPropertyEditor {

   public void setAsText(String txt) {
      setValue(getAsValue(txt));
   }

   public Object getAsValue(String txt) {
      if (txt == null || txt.length() == 0)
         throw new PropertyEditorException(PropertyMessage.EMPTY_BOOLEAN, txt);
      try {
         return Boolean.valueOf(txt);
      } catch (Exception e) {
         throw new PropertyEditorException(PropertyMessage.BAD_BOOLEAN, txt);
      }
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -