|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.validation.Validation<T> edu.nrao.sss.validation.DataNotEnteredValidation<T>
public abstract class DataNotEnteredValidation<T>
A validation for empty or unitialized properties.
Subclasses of this validation need only a constructor and
an implementation of getCurrentValue()
.
Version Info:
$Revision: 868 $ |
$Date: 2007-09-12 13:15:10 -0600 (Wed, 12 Sep 2007) $ |
$Author: dharland $ |
Field Summary | |
---|---|
protected String |
defaultValue
See constructor documentation. |
protected String |
fieldName
See constructor documentation. |
protected String |
genericTargetName
See constructor documentation. |
protected String |
specificTargetName
Instead of a generic concept name, implementing classes can use the name of a specific instance. |
Fields inherited from class edu.nrao.sss.validation.Validation |
---|
container, purpose, severity |
Constructor Summary | |
---|---|
protected |
DataNotEnteredValidation(AbstractValidator<T> validationContainer,
ValidationPurpose reasonForValidation,
String genericNameOfTarget,
String nameOfField,
String defaultValueOfField)
Helps create an instance. |
Method Summary | |
---|---|
protected String |
debugMessage()
Returns a technical message to be used if this validation fails. |
protected String |
displayMessage()
Returns a user-friendly message to be used if this validation fails. |
protected abstract String |
getCurrentValue()
The current value of the targeted field, in text form. |
protected boolean |
passesTest()
Test is passed if current value is non-null, non-empty, and not in its default state. |
Methods inherited from class edu.nrao.sss.validation.Validation |
---|
getName, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String genericTargetName
constructor
documentation.
protected String specificTargetName
For instance, a generic name might be "user", whereas the target
of this validation is the specific user "Mother Theresa". In this
situation, the implementing class would preferentially use
"Mother Theresa", which will make the resulting failure message
easier to understand for a human user. The best time to set
this value is in the getCurrentValue()
method.
protected String fieldName
constructor
documentation.
protected String defaultValue
constructor
documentation.
Constructor Detail |
---|
protected DataNotEnteredValidation(AbstractValidator<T> validationContainer, ValidationPurpose reasonForValidation, String genericNameOfTarget, String nameOfField, String defaultValueOfField)
validationContainer
- The validator that will use this validation.reasonForValidation
- The reason we are doing this validation.genericNameOfTarget
- A generic name for the target of the validation. Examples:
"User", "Project", "Scheduling Block".nameOfField
- The name of the field for which data was not entered.
A name that is suitable for presentation to a human user is
suggested. Examples: "social security number", "last name",
"LST".defaultValueOfField
- The value this field has if it has not been changed from its
default state. This validation will fail if the current value
of the field being checked is null, the empty string
(""), or this default value.Method Detail |
---|
protected abstract String getCurrentValue()
protected boolean passesTest()
passesTest
in class Validation<T>
protected String displayMessage()
Validation
displayMessage
in class Validation<T>
protected String debugMessage()
Validation
debugMessage
in class Validation<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |