jaxx.runtime
Class BeanValidatorUtil

java.lang.Object
  extended by jaxx.runtime.BeanValidatorUtil

public class BeanValidatorUtil
extends java.lang.Object

The helper class for validation module.

Author:
chemit

Constructor Summary
protected BeanValidatorUtil()
           
 
Method Summary
static void convert(BeanValidator<?> validator, java.lang.String fieldName, java.lang.String value, java.lang.Class<?> valueClass)
          Convert a value to a given type and then if was succesffull try to set it in the bean manage by the validator.
static java.beans.EventSetDescriptor getPropertyChangeListenerDescriptor(java.lang.Class beanClass)
           
static com.opensymphony.xwork2.util.ValueStack getSharedValueStack()
           
static void setValidatorBean(JAXXObject ui, java.lang.Object bean, java.lang.String... excludeIds)
          Convinient method to attach a bean to all validators of an JAXXObject.
static void setValidatorChanged(JAXXObject ui, boolean newValue, java.lang.String... excludeIds)
          Convinient method to set the changed property to all validators of an JAXXObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanValidatorUtil

protected BeanValidatorUtil()
Method Detail

getSharedValueStack

public static com.opensymphony.xwork2.util.ValueStack getSharedValueStack()

setValidatorBean

public static void setValidatorBean(JAXXObject ui,
                                    java.lang.Object bean,
                                    java.lang.String... excludeIds)
Convinient method to attach a bean to all validators of an JAXXObject.

It is possible to exclude some validator to be treated.

Parameters:
ui - the ui containing the validatros to treate
bean - the bean to attach in validators (can be null)
excludeIds - the list of validator id to exclude

setValidatorChanged

public static void setValidatorChanged(JAXXObject ui,
                                       boolean newValue,
                                       java.lang.String... excludeIds)
Convinient method to set the changed property to all validators of an JAXXObject.

It is possible to exclude some validator to be treated.

Parameters:
ui - the ui containing the validatros to treate
newValue - the new value to set in changed validator property
excludeIds - the list of validator id to exclude

convert

public static void convert(BeanValidator<?> validator,
                           java.lang.String fieldName,
                           java.lang.String value,
                           java.lang.Class<?> valueClass)
Convert a value to a given type and then if was succesffull try to set it in the bean manage by the validator.

Parameters:
validator - validator to be involved
fieldName - the name of the bean property
value - the actual value to convert
valueClass - the type of the conversion

getPropertyChangeListenerDescriptor

public static java.beans.EventSetDescriptor getPropertyChangeListenerDescriptor(java.lang.Class beanClass)


Copyright © 2008-2009 CodeLutin. All Rights Reserved.