All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sdi.wap.Field

java.lang.Object
   |
   +----com.sdi.wap.Field

public abstract class Field
extends Object
implements Validatable, Serializable
Superclass of numerous Field implementations for each of the field types managed by this application.

Author:
Brad Cox

Variable Index

 o isValid
A boolean indicating whether the syntactic validity requirements of this type have been met.
 o message
A string explaining any validation errors in terms an end-user can understand
 o msgNull
 o value
The value of this field as a string.

Constructor Index

 o Field(String)
Constructor.

Method Index

 o equals(Field)
Are these types equal???
 o equals(String)
Are these types equal???
 o getMessage()
Return the validation message.
 o getValue()
Get the value of this type
 o identifyInvalid(Field[])
Identify invalid args
 o isValid()
Is this value valid?
 o re(String)
Convenience method to help subclasses build regular expressions as class initializers without screwing around with REexception.
 o requireLength(int, int)
Require value.length to be between min and max
 o requireLengthMax(int)
Require value.length to be < max
 o requireLengthMin(int)
Require value.length to be >= min.
 o requireMatch(RE, String)
Require regular expression match
 o requireNonNull()
Require the value to not be null or ""
 o setValid(boolean, String)
Set isValid flag to ok, and if false, change the message to message.
 o setValue(String)
Set the value of this type (and return the old value just in case)
 o setValue(String, boolean, String)
Set isValid flag to ok, and if false, change the message to message.
 o toString()
Insert the method's description here.
 o toStringFull()
Insert the method's description here.

Variables

 o value
 private String value
The value of this field as a string.

 o message
 private String message
A string explaining any validation errors in terms an end-user can understand

 o isValid
 private boolean isValid
A boolean indicating whether the syntactic validity requirements of this type have been met.

 o msgNull
 private static final String msgNull

Constructors

 o Field
 public Field(String v)
Constructor.

Methods

 o equals
 public boolean equals(Field that)
Are these types equal???

Parameters:
that - com.sdi.field.FieldImpl
Returns:
boolean
 o equals
 public boolean equals(String that)
Are these types equal???

Parameters:
that - com.sdi.field.FieldImpl
Returns:
boolean
 o getMessage
 public String getMessage()
Return the validation message. This is contructed only at this late date to cut down on instance creation.

 o getValue
 public String getValue()
Get the value of this type

 o identifyInvalid
 public static final String identifyInvalid(Field args[])
Identify invalid args

 o isValid
 public boolean isValid()
Is this value valid?

 o re
 protected static final RE re(String s)
Convenience method to help subclasses build regular expressions as class initializers without screwing around with REexception. in class initializers. This class catches all REexceptions, logs them, and blithely contiues, returning null. Caveat emptor.

Parameters:
eter - String s: the regular expression
 o requireLength
 protected boolean requireLength(int min,
                                 int max)
Require value.length to be between min and max

 o requireLengthMax
 protected boolean requireLengthMax(int max)
Require value.length to be < max

 o requireLengthMin
 protected boolean requireLengthMin(int min)
Require value.length to be >= min.

 o requireMatch
 protected boolean requireMatch(RE re,
                                String m)
Require regular expression match

 o requireNonNull
 protected boolean requireNonNull()
Require the value to not be null or ""

 o setValid
 public boolean setValid(boolean ok,
                         String m)
Set isValid flag to ok, and if false, change the message to message.

 o setValue
 public abstract boolean setValue(String v)
Set the value of this type (and return the old value just in case)

 o setValue
 public boolean setValue(String v,
                         boolean ok,
                         String message)
Set isValid flag to ok, and if false, change the message to message.

 o toString
 public String toString()
Insert the method's description here. Creation date: (8/18/2000 5:30:59 PM)

Returns:
java.lang.String
Overrides:
toString in class Object
 o toStringFull
 public String toStringFull()
Insert the method's description here. Creation date: (8/18/2000 5:30:59 PM)

Returns:
java.lang.String

All Packages  Class Hierarchy  This Package  Previous  Next  Index