org.mod4j.runtime.validation
Class BusinessRuleUtils

java.lang.Object
  extended by org.mod4j.runtime.validation.BusinessRuleUtils

Deprecated.

public class BusinessRuleUtils
extends java.lang.Object

This class implements some common checks on fields. It uses the ValidationUtils class of the Spring framework to collect and report errors.

Author:
Eric Jan Malotaux

Constructor Summary
BusinessRuleUtils()
          Deprecated.  
 
Method Summary
static void validateEmptyOrWhitespace(org.springframework.validation.Errors errors, java.lang.String field)
          Deprecated.  
static void validateMaxLength(org.springframework.validation.Errors errors, java.lang.String field, int max)
          Deprecated.  
static void validateMaxValue(org.springframework.validation.Errors errors, java.lang.String field, long max)
          Deprecated.  
static void validateMinLength(org.springframework.validation.Errors errors, java.lang.String field, int min)
          Deprecated.  
static void validateMinValue(org.springframework.validation.Errors errors, java.lang.String field, long min)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BusinessRuleUtils

public BusinessRuleUtils()
Deprecated. 
Method Detail

validateEmptyOrWhitespace

public static void validateEmptyOrWhitespace(org.springframework.validation.Errors errors,
                                             java.lang.String field)
Deprecated. 

Reject the given field if the value is empty or just contains whitespace. An 'empty' value in this context means either null, the empty string "", or consisting wholly of whitespace. The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors -
field -

validateMinLength

public static void validateMinLength(org.springframework.validation.Errors errors,
                                     java.lang.String field,
                                     int min)
Deprecated. 

Reject the given field if the string value is shorter than the minimum length given in min. The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors -
field -
min -

validateMaxLength

public static void validateMaxLength(org.springframework.validation.Errors errors,
                                     java.lang.String field,
                                     int max)
Deprecated. 

Reject the given field if the string value is shorter than the maximum length given in max. The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors -
field -
max -

validateMaxValue

public static void validateMaxValue(org.springframework.validation.Errors errors,
                                    java.lang.String field,
                                    long max)
Deprecated. 

Reject the given field if the long value is more than the maximum value given in max. The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors -
field -
max -

validateMinValue

public static void validateMinValue(org.springframework.validation.Errors errors,
                                    java.lang.String field,
                                    long min)
Deprecated. 

Reject the given field if the long value is less than the minimum value given in min. The object whose field is being validated does not need to be passed in because the Errors instance can resolve field values by itself (it will usually hold an internal reference to the target object).

Parameters:
errors -
field -
min -


Copyright © 2009. All Rights Reserved.