webwork.action
Class ValidationEditorSupport

java.lang.Object
  extended byjava.beans.PropertyEditorSupport
      extended bywebwork.action.ValidationEditorSupport
All Implemented Interfaces:
java.beans.PropertyEditor
Direct Known Subclasses:
AccountEditor, AmountEditor, BigDecimalEditor, BooleanEditor, BooleanObjectEditor, ByteEditor, ByteObjectEditor, DateEditor, DateFormatEditor, DoubleEditor, DoubleObjectEditor, FloatEditor, FloatObjectEditor, IntegerEditor, IntegerObjectEditor, LongEditor, LongObjectEditor, NameEditor, NameEditor, PasswordEditor, ShortEditor, ShortObjectEditor, StringEditor

public abstract class ValidationEditorSupport
extends java.beans.PropertyEditorSupport

This is a useful base class for JavaBeans property editors whose main purpose is to provide validation of form input parameters. Overriding setAsText is sufficient. Do whatever validation you need and throw IllegalArgumentException if something is wrong. If all is ok then set the protected attribute "value" to the converted value (may be a string).

Version:
$Revision: 1.6 $
Author:
Rickard Öberg (rickard@middleware-company.com)
See Also:
PropertyEditorSupport, BeanInfo

Field Summary
protected  java.lang.Object value
           
 
Constructor Summary
ValidationEditorSupport()
           
 
Method Summary
 java.lang.String getAsText()
           
 java.lang.String getAsText(java.lang.Object val)
          This method is specified in the FastPropertyEditor interface and it is implemented here for convenience
 java.lang.Object getValue()
           
abstract  void setAsText(java.lang.String txt)
           
 void setValue(java.lang.Object val)
           
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getTags, isPaintable, paintValue, removePropertyChangeListener, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected java.lang.Object value
Constructor Detail

ValidationEditorSupport

public ValidationEditorSupport()
Method Detail

setValue

public void setValue(java.lang.Object val)

getAsText

public java.lang.String getAsText()

getAsText

public java.lang.String getAsText(java.lang.Object val)
This method is specified in the FastPropertyEditor interface and it is implemented here for convenience


setAsText

public abstract void setAsText(java.lang.String txt)

getValue

public java.lang.Object getValue()


Copyright © 2001-2003 WebWork All Rights Reserved.