org.sapia.validator
Class ValidationContext

java.lang.Object
  extended by org.sapia.validator.ValidationContext

public class ValidationContext
extends Object

This class models the execution context of Validatable instances. An instance of this class is not thread-safe.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Constructor Summary
ValidationContext(Map globals, Object toValidate, Vlad cfg, Locale locale)
          Constructor for ValidationContext.
ValidationContext(Map globals, Object toValidate, Vlad cfg, Locale locale, Map contextMap)
          Constructor for ValidationContext with contextual object map.
 
Method Summary
 Object get()
          Returns the current object on this context's stack.
 Object get(String name)
          This method first attempts looking up in the map of this instance; if no object is found, it resorts to the global map.
 Vlad getConfig()
          Returns this instance's validator.
 Object getGlobal(String name)
           
 Locale getLocale()
          Returns this instance's Locale.
 Status getStatus()
          Returns this instance's execution status.
 Object pop()
          Pops the current object from this context's stack.
 void push(Object toValidate)
          Pushes the given object on this context's stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationContext

public ValidationContext(Map globals,
                         Object toValidate,
                         Vlad cfg,
                         Locale locale)
Constructor for ValidationContext.


ValidationContext

public ValidationContext(Map globals,
                         Object toValidate,
                         Vlad cfg,
                         Locale locale,
                         Map contextMap)
Constructor for ValidationContext with contextual object map.

Method Detail

get

public Object get()
Returns the current object on this context's stack.

Returns:
an Object.

push

public void push(Object toValidate)
Pushes the given object on this context's stack.

Parameters:
toValidate - an Object to validate.

pop

public Object pop()
Pops the current object from this context's stack.

Returns:
an Object.

getGlobal

public Object getGlobal(String name)
Parameters:
name - the name of a global value.
See Also:
Vlad.getGlobal(String)

get

public Object get(String name)
This method first attempts looking up in the map of this instance; if no object is found, it resorts to the global map.

Parameters:
name - the name of the desired value.
Returns:
the Object corresponding to the given name, or null if no such object exists.

getConfig

public Vlad getConfig()
Returns this instance's validator.

Returns:
a Vlad.

getLocale

public Locale getLocale()
Returns this instance's Locale.

Returns:
a Locale.

getStatus

public Status getStatus()
Returns this instance's execution status.

Returns:
a Status.


Copyright © 2002 Sapia Open Community, Inc. All Rights Reserved.