org.springmodules.validation.bean.context
Class ValidationContextHolder

java.lang.Object
  extended by org.springmodules.validation.bean.context.ValidationContextHolder

public class ValidationContextHolder
extends Object

A holder to hold thread bound validation contexts. Calling setValidationContext(ValidationContext) and then getValidationContext() by the same thread garenteas that the second call will return the same runtime ValidationContext instance as was set by the first call.

Author:
Uri Boness

Constructor Summary
ValidationContextHolder()
           
 
Method Summary
static void clearContext()
          Clears this holder.
static ValidationContext getValidationContext()
          Returns the ValidationContext held by this holder, or null if nothing is held.
static void setValidationContext(ValidationContext context)
          Sets the ${ValidationContext} to be held by this holder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationContextHolder

public ValidationContextHolder()
Method Detail

getValidationContext

public static ValidationContext getValidationContext()
Returns the ValidationContext held by this holder, or null if nothing is held.

Returns:
The ValidationContext held by this holder.

setValidationContext

public static void setValidationContext(ValidationContext context)
Sets the ${ValidationContext} to be held by this holder.

Parameters:
context -

clearContext

public static void clearContext()
Clears this holder. After calling the method this holder will no longer hold any validation context. *



Copyright © 2009. All Rights Reserved.