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
-
isValid
- A boolean indicating whether the syntactic validity requirements of this
type have been met.
-
message
- A string explaining any validation errors in terms an end-user can understand
-
msgNull
-
-
value
- The value of this field as a string.
-
Field(String)
- Constructor.
-
equals(Field)
- Are these types equal???
-
equals(String)
- Are these types equal???
-
getMessage()
- Return the validation message.
-
getValue()
- Get the value of this type
-
identifyInvalid(Field[])
- Identify invalid args
-
isValid()
- Is this value valid?
-
re(String)
- Convenience method to help subclasses build regular expressions
as class initializers without screwing around with REexception.
-
requireLength(int, int)
- Require value.length to be between min and max
-
requireLengthMax(int)
- Require value.length to be < max
-
requireLengthMin(int)
- Require value.length to be >= min.
-
requireMatch(RE, String)
- Require regular expression match
-
requireNonNull()
- Require the value to not be null or ""
-
setValid(boolean, String)
- Set isValid flag to ok, and if false, change the message to message.
-
setValue(String)
- Set the value of this type (and return the old value just in case)
-
setValue(String, boolean, String)
- Set isValid flag to ok, and if false, change the message to message.
-
toString()
- Insert the method's description here.
-
toStringFull()
- Insert the method's description here.
value
private String value
- The value of this field as a string.
message
private String message
- A string explaining any validation errors in terms an end-user can understand
isValid
private boolean isValid
- A boolean indicating whether the syntactic validity requirements of this
type have been met.
msgNull
private static final String msgNull
Field
public Field(String v)
- Constructor.
equals
public boolean equals(Field that)
- Are these types equal???
- Parameters:
- that - com.sdi.field.FieldImpl
- Returns:
- boolean
equals
public boolean equals(String that)
- Are these types equal???
- Parameters:
- that - com.sdi.field.FieldImpl
- Returns:
- boolean
getMessage
public String getMessage()
- Return the validation message. This is contructed only at this late
date to cut down on instance creation.
getValue
public String getValue()
- Get the value of this type
identifyInvalid
public static final String identifyInvalid(Field args[])
- Identify invalid args
isValid
public boolean isValid()
- Is this value valid?
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
requireLength
protected boolean requireLength(int min,
int max)
- Require value.length to be between min and max
requireLengthMax
protected boolean requireLengthMax(int max)
- Require value.length to be < max
requireLengthMin
protected boolean requireLengthMin(int min)
- Require value.length to be >= min.
requireMatch
protected boolean requireMatch(RE re,
String m)
- Require regular expression match
requireNonNull
protected boolean requireNonNull()
- Require the value to not be null or ""
setValid
public boolean setValid(boolean ok,
String m)
- Set isValid flag to ok, and if false, change the message to message.
setValue
public abstract boolean setValue(String v)
- Set the value of this type (and return the old value just in case)
setValue
public boolean setValue(String v,
boolean ok,
String message)
- Set isValid flag to ok, and if false, change the message to message.
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
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