Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.richfaces.validator
Class BeanValidator

    java.lang.Object
      org.richfaces.validator.BeanValidator

    public class BeanValidator

extends java.lang.Object

Perform validation by Hibernate Validator annotations

Author:
  asmirnov

Field Summary
`static java.lang.String` | `VALIDATOR_PARAM`

Method Summary
`protected java.util.Locale` | `calculateLocale(javax.faces.context.FacesContext context)`
`static BeanValidator` | `getInstance(javax.faces.context.FacesContext context)` Return BeanValidator object from a ServletContext attribute.
`protected` | `getValidator(java.lang.Class<? extends java.lang.Object> beanClass, java.util.Locale locale)` Get ( or create ) `ClassValidator` for a given bean class.
`java.lang.String[]` | `validate(javax.faces.context.FacesContext context, javax.el.ValueExpression target, java.lang.Object value)` Perform Validation for a new value.
`java.lang.String[]` | `validate(java.lang.Object base, java.lang.String property, java.lang.Object value, java.util.Locale locale)` Validate bean property for a new value.
`protected InvalidValue[]` | `validateBean(java.lang.Object base, java.lang.String property, java.lang.Object value, java.util.Locale locale)` Validate bean property of the base object aganist new value
`protected InvalidValue[]` | `validateClass(java.lang.Class<? extends java.lang.Object> beanClass, java.lang.String property, java.lang.Object value, java.util.Locale locale)` Validate bean property in the base class aganist new value.
`java.lang.String[]` | `validateGraph(javax.faces.context.FacesContext context, java.lang.Object value, java.util.Set<java.lang.String> profiles)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### VALIDATOR_PARAM

    public static final java.lang.String VALIDATOR_PARAM

Method Detail

### getInstance

    public static BeanValidator getInstance(javax.faces.context.FacesContext context)

  Return BeanValidator object from a ServletContext attribute. Create new instance if none is defined.

  Parameters:
    `context` -
  Returns:

### validate

    public java.lang.String[] validate(javax.faces.context.FacesContext context,
                                       javax.el.ValueExpression target,
                                       java.lang.Object value)

  Perform Validation for a new value.

  Parameters:
    `context` - current faces context.
    `target` - `ValueExpression` for a value assignment.
    `value` - new value for validation
  Returns:
    null if no validation errors. Array of the validation messages otherwise.
  Throws:
    `javax.faces.FacesException` - if locale or context not properly initialized

### calculateLocale

    protected java.util.Locale calculateLocale(javax.faces.context.FacesContext context)

### validate

    public java.lang.String[] validate(java.lang.Object base,
                                       java.lang.String property,
                                       java.lang.Object value,
                                       java.util.Locale locale)

  Validate bean property for a new value. TODO - localization ?

  Parameters:
    `base` - - bean
    `property` - - bean property name.
    `value` - new value.
  Returns:
    null for a valid value, array of the validation messages othervise.

### validateGraph

    public java.lang.String[] validateGraph(javax.faces.context.FacesContext context,
                                            java.lang.Object value,
                                            java.util.Set<java.lang.String> profiles)

### validateBean

    protected InvalidValue[] validateBean(java.lang.Object base,
                                          java.lang.String property,
                                          java.lang.Object value,
                                          java.util.Locale locale)

  Validate bean property of the base object aganist new value

  Parameters:
    `base` -
    `property` -
    `value` -
  Returns:

### validateClass

    protected InvalidValue[] validateClass(java.lang.Class<? extends java.lang.Object> beanClass,
                                           java.lang.String property,
                                           java.lang.Object value,
                                           java.util.Locale locale)

  Validate bean property in the base class aganist new value.

  Parameters:
    `beanClass` -
    `property` -
    `value` -
  Returns:

### getValidator

    protected  getValidator(java.lang.Class<? extends java.lang.Object> beanClass,
                                 java.util.Locale locale)

  Get ( or create ) `ClassValidator` for a given bean class.

  Parameters:
    `beanClass` -
  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008. All Rights Reserved.