org.infoglue.cms.util.validators
Class AbstractValidator

java.lang.Object
  extended by org.infoglue.cms.util.validators.AbstractValidator
Direct Known Subclasses:
FloatValidator, IntegerValidator, StringValidator

public abstract class AbstractValidator
extends java.lang.Object

Time is running out, the illusion fades away... This package will be refactored/extended after iteration 1. - move to com.holigrow.yoda.util.validators ? - interfaces + factory - constructor madness (setXXX instead of N constructors?) - more validators - more fun


Constructor Summary
protected AbstractValidator(java.lang.String fieldName)
           
protected AbstractValidator(java.lang.String fieldName, boolean isRequired)
           
protected AbstractValidator(java.lang.String fieldName, boolean isRequired, boolean mustBeUnique, java.lang.Class objectClass, java.lang.Integer excludeId, java.lang.Object excludeObject)
           
 
Method Summary
protected  void addConstraintException(java.lang.String errorCode)
           
protected  void failIfAnyExceptionsFound()
           
 java.lang.Integer getExcludeId()
          Returns the excludeId.
 java.lang.Object getExcludeObject()
          Returns the excludeName.
 java.lang.String getFieldName()
          Returns the fieldName.
 java.lang.Class getObjectClass()
          Returns the objectClass.
 boolean isMustBeUnique()
          Returns the mustBeUnique.
 boolean isRequired()
          Returns the isRequired.
 void setExcludeId(java.lang.Integer excludeId)
          Sets the excludeId.
 void setExcludeObject(java.lang.Object excludeObject)
          Sets the excludeId.
 void setFieldName(java.lang.String fieldName)
          Sets the fieldName.
 void setIsRequired(boolean isRequired)
          Sets the isRequired.
 void setMustBeUnique(boolean mustBeUnique)
          Sets the mustBeUnique.
 void setObjectClass(java.lang.Class objectClass)
          Sets the objectClass.
protected  void validateIsRequired(java.lang.Object value)
           
protected  void validateUniqueness(java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractValidator

protected AbstractValidator(java.lang.String fieldName)

AbstractValidator

protected AbstractValidator(java.lang.String fieldName,
                            boolean isRequired)

AbstractValidator

protected AbstractValidator(java.lang.String fieldName,
                            boolean isRequired,
                            boolean mustBeUnique,
                            java.lang.Class objectClass,
                            java.lang.Integer excludeId,
                            java.lang.Object excludeObject)
Method Detail

validateIsRequired

protected void validateIsRequired(java.lang.Object value)
                           throws ConstraintException
Throws:
ConstraintException

validateUniqueness

protected void validateUniqueness(java.lang.String value)
                           throws ConstraintException,
                                  SystemException
Throws:
ConstraintException
SystemException

addConstraintException

protected final void addConstraintException(java.lang.String errorCode)

failIfAnyExceptionsFound

protected final void failIfAnyExceptionsFound()
                                       throws ConstraintException
Throws:
ConstraintException

getFieldName

public java.lang.String getFieldName()
Returns the fieldName.

Returns:
String

setFieldName

public void setFieldName(java.lang.String fieldName)
Sets the fieldName.

Parameters:
fieldName - The fieldName to set

isRequired

public boolean isRequired()
Returns the isRequired.

Returns:
boolean

setIsRequired

public void setIsRequired(boolean isRequired)
Sets the isRequired.

Parameters:
isRequired - The isRequired to set

isMustBeUnique

public boolean isMustBeUnique()
Returns the mustBeUnique.

Returns:
boolean

setMustBeUnique

public void setMustBeUnique(boolean mustBeUnique)
Sets the mustBeUnique.

Parameters:
mustBeUnique - The mustBeUnique to set

getObjectClass

public java.lang.Class getObjectClass()
Returns the objectClass.

Returns:
Class

setObjectClass

public void setObjectClass(java.lang.Class objectClass)
Sets the objectClass.

Parameters:
objectClass - The objectClass to set

getExcludeId

public java.lang.Integer getExcludeId()
Returns the excludeId.

Returns:
int

setExcludeId

public void setExcludeId(java.lang.Integer excludeId)
Sets the excludeId.

Parameters:
excludeId - The excludeId to set

getExcludeObject

public java.lang.Object getExcludeObject()
Returns the excludeName.

Returns:
int

setExcludeObject

public void setExcludeObject(java.lang.Object excludeObject)
Sets the excludeId.

Parameters:
excludeId - The excludeId to set


Copyright © 2005 InfoGlue.org All Rights Reserved.