org.apache.cocoon.acting
Class ValidatorActionHelper

java.lang.Object
  extended by org.apache.cocoon.acting.ValidatorActionHelper

public class ValidatorActionHelper
extends Object

Helper class to pass the result of a validation back along with the validated object itself.

Version:
CVS $Id: ValidatorActionHelper.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Christian Haul

Field Summary
protected  Object object
           
protected  ValidatorActionResult result
           
 
Constructor Summary
ValidatorActionHelper(Object validatedObject)
          Create a ValidatorActionHelper object that contains just the object.
ValidatorActionHelper(Object validatedObject, ValidatorActionResult validationResult)
          Create a ValidatorActionHelper object that contains just the object.
 
Method Summary
 boolean doesNotMatch()
          Tests if the validation result is NOMATCH, can only occur when
 Object getObject()
          Returns the tested object.
 ValidatorActionResult getResult()
          Returns the result.
 boolean isNotPresent()
          Tests if the validation result is NOTPRESENT, e.g. when the value is null and is allowed to be null.
 boolean isNull()
          Tests if the validation result is ISNULL, e.g. when the value is null but is not supposed to be null.
 boolean isOK()
          Tests if the validation result is OK
 boolean isTooLarge()
          Tests if the validation result is TOOLARGE, e.g. in case of a double or long the value is too large or in case of a string it is too long.
 boolean isTooSmall()
          Tests if the validation result is TOOSMALL, e.g. in case of a double or long the value is too small or in case of a string it is too short.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

protected ValidatorActionResult result

object

protected Object object
Constructor Detail

ValidatorActionHelper

public ValidatorActionHelper(Object validatedObject)
Create a ValidatorActionHelper object that contains just the object. Defaults to OK as validation result.

Parameters:
validatedObject - object that has been validated

ValidatorActionHelper

public ValidatorActionHelper(Object validatedObject,
                             ValidatorActionResult validationResult)
Create a ValidatorActionHelper object that contains just the object. Defaults to OK as validation result.

Parameters:
validatedObject - object that has been validated
validationResult - result of the validation
Method Detail

isOK

public boolean isOK()
Tests if the validation result is OK


isNotPresent

public boolean isNotPresent()
Tests if the validation result is NOTPRESENT, e.g. when the value is null and is allowed to be null.


isNull

public boolean isNull()
Tests if the validation result is ISNULL, e.g. when the value is null but is not supposed to be null.


isTooLarge

public boolean isTooLarge()
Tests if the validation result is TOOLARGE, e.g. in case of a double or long the value is too large or in case of a string it is too long.


isTooSmall

public boolean isTooSmall()
Tests if the validation result is TOOSMALL, e.g. in case of a double or long the value is too small or in case of a string it is too short.


doesNotMatch

public boolean doesNotMatch()
Tests if the validation result is NOMATCH, can only occur when


getObject

public Object getObject()
Returns the tested object.


getResult

public ValidatorActionResult getResult()
Returns the result.



Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.