org.jtheque.core.utils.ui.constraints
Class NotNullConstraint

java.lang.Object
  extended by org.jtheque.core.utils.ui.constraints.NotNullConstraint
All Implemented Interfaces:
Constraint

public final class NotNullConstraint
extends java.lang.Object
implements Constraint

A constraint to indicate that the field cannot be null.

Author:
Baptiste Wicht

Constructor Summary
NotNullConstraint(java.lang.String fieldName)
          Construct a new NotNullConstraint.
 
Method Summary
 boolean canBeNullOrEmpty()
          Indicate if the value can be null or not.
 int maxLength()
          Return the max length of the value.
 boolean mustBeNumerical()
          Indicate if the value must be numerical or not.
 boolean mustControlLength()
          Indicate if we must control length or not.
 void validate(java.lang.Object field, java.util.Collection<JThequeError> errors)
          Validate the field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotNullConstraint

public NotNullConstraint(java.lang.String fieldName)
Construct a new NotNullConstraint.

Parameters:
fieldName - The field name.
Method Detail

maxLength

public int maxLength()
Description copied from interface: Constraint
Return the max length of the value.

Specified by:
maxLength in interface Constraint
Returns:
The max length of the value.

mustBeNumerical

public boolean mustBeNumerical()
Description copied from interface: Constraint
Indicate if the value must be numerical or not.

Specified by:
mustBeNumerical in interface Constraint
Returns:
true if teh value must be numerical else false.

canBeNullOrEmpty

public boolean canBeNullOrEmpty()
Description copied from interface: Constraint
Indicate if the value can be null or not.

Specified by:
canBeNullOrEmpty in interface Constraint
Returns:
true if the value can be null else false.

mustControlLength

public boolean mustControlLength()
Description copied from interface: Constraint
Indicate if we must control length or not.

Specified by:
mustControlLength in interface Constraint
Returns:
true if we must control length else false.

validate

public void validate(java.lang.Object field,
                     java.util.Collection<JThequeError> errors)
Description copied from interface: Constraint
Validate the field.

Specified by:
validate in interface Constraint
Parameters:
field - The field to validate.
errors - The errors list.


Copyright © 2009 JTheque. All Rights Reserved.