org.jtheque.core.utils.ui.constraints
Interface Constraint

All Known Implementing Classes:
MaxLenghtConstraint, NotNullConstraint

public interface Constraint

A constraint on an entity property.

Author:
Baptiste Wicht

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.
 

Method Detail

maxLength

int maxLength()
Return the max length of the value.

Returns:
The max length of the value.

mustBeNumerical

boolean mustBeNumerical()
Indicate if the value must be numerical or not.

Returns:
true if teh value must be numerical else false.

canBeNullOrEmpty

boolean canBeNullOrEmpty()
Indicate if the value can be null or not.

Returns:
true if the value can be null else false.

mustControlLength

boolean mustControlLength()
Indicate if we must control length or not.

Returns:
true if we must control length else false.

validate

void validate(java.lang.Object field,
              java.util.Collection<JThequeError> errors)
Validate the field.

Parameters:
field - The field to validate.
errors - The errors list.


Copyright © 2009 JTheque. All Rights Reserved.