org.apache.bval.model
Interface ValidationContext<T extends ValidationListener>

All Known Subinterfaces:
GroupValidationContext<T>
All Known Implementing Classes:
BeanValidationContext, GroupValidationContextImpl

public interface ValidationContext<T extends ValidationListener>

Description: Interface of the context that holds all state information during the validation process


Method Summary
 boolean collectValidated()
          Avoid recursion by recording the current state of this context as having been validated.
 AccessStrategy getAccess()
          Get the current access strategy.
 Object getBean()
          Get the bean.
 T getListener()
          Get the ValidationListener.
 MetaBean getMetaBean()
          Get the model meta-bean.
 MetaProperty getMetaProperty()
          Get the model meta-property.
 String getPropertyName()
          Get the property name.
 Object getPropertyValue()
          Get the property value.
 Object getPropertyValue(AccessStrategy access)
          Get the value by using the given access strategy.
 void moveDown(MetaProperty prop, AccessStrategy access)
          Step deeper into association at 'prop'
 void moveUp(Object bean, MetaBean metaBean)
          Step out from a validation of associated objects.
 void setBean(Object bean)
          Set the bean.
 void setBean(Object aBean, MetaBean aMetaBean)
          Set the current bean/metabean.
 void setCurrentIndex(Integer index)
          Set the index of the object currently validated into the context.
 void setCurrentKey(Object key)
          set the key of the object in a map currently validated into the context.
 void setMetaBean(MetaBean metaBean)
          Set the model meta-bean.
 void setMetaProperty(MetaProperty metaProperty)
          Set the current meta-property.
 

Method Detail

getPropertyValue

Object getPropertyValue()
Get the property value.

Returns:
Object

getPropertyValue

Object getPropertyValue(AccessStrategy access)
Get the value by using the given access strategy.

Parameters:
access -
Returns:
Object

getPropertyName

String getPropertyName()
Get the property name.

Returns:
String

getListener

T getListener()
Get the ValidationListener.

Returns:
T

getBean

Object getBean()
Get the bean.

Returns:
Object

getMetaBean

MetaBean getMetaBean()
Get the model meta-bean.

Returns:
MetaBean

setMetaBean

void setMetaBean(MetaBean metaBean)
Set the model meta-bean.

Parameters:
metaBean -

getMetaProperty

MetaProperty getMetaProperty()
Get the model meta-property.

Returns:
MetaProperty

setBean

void setBean(Object bean)
Set the bean.

Parameters:
bean -

collectValidated

boolean collectValidated()
Avoid recursion by recording the current state of this context as having been validated.

Returns:
true when this state had not already been recorded

setBean

void setBean(Object aBean,
             MetaBean aMetaBean)
Set the current bean/metabean.

Parameters:
aBean -
aMetaBean -

setMetaProperty

void setMetaProperty(MetaProperty metaProperty)
Set the current meta-property.

Parameters:
metaProperty -

moveDown

void moveDown(MetaProperty prop,
              AccessStrategy access)
Step deeper into association at 'prop'

Parameters:
prop -
access -

moveUp

void moveUp(Object bean,
            MetaBean metaBean)
Step out from a validation of associated objects.

Parameters:
bean -
metaBean -

setCurrentIndex

void setCurrentIndex(Integer index)
Set the index of the object currently validated into the context. used to create the propertyPath with [index] information for collections.

Parameters:
index -

setCurrentKey

void setCurrentKey(Object key)
set the key of the object in a map currently validated into the context. used to create the propertyPath with [key] information for maps.

Parameters:
key -

getAccess

AccessStrategy getAccess()
Get the current access strategy.

Returns:
AccessStrategy


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