org.omnifaces.eventlistener
Class BeanValidationEventListener

java.lang.Object
  extended by org.omnifaces.eventlistener.BeanValidationEventListener
All Implemented Interfaces:
java.util.EventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListener

public class BeanValidationEventListener
extends java.lang.Object
implements javax.faces.event.SystemEventListener

Overrides BeanValidator.setValidationGroups(String) for all components in the current view. This allows to temporarily use different validationGroups or disabling validation if a specific UICommand or UIInput has invoked the form submit.

Since:
1.3
Author:
Adrian Gygax, Bauke Scholtz

Constructor Summary
BeanValidationEventListener(java.lang.String validationGroups, boolean disabled)
          Construct an instance of bean validation event listener based on the given validation groups and disabled state.
 
Method Summary
 boolean isListenerForSource(java.lang.Object source)
          Only listens to UIInput components which have a BeanValidator assigned.
 void processEvent(javax.faces.event.SystemEvent event)
          Handle the PreValidateEvent and PostValidateEvent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanValidationEventListener

public BeanValidationEventListener(java.lang.String validationGroups,
                                   boolean disabled)
Construct an instance of bean validation event listener based on the given validation groups and disabled state.

Method Detail

isListenerForSource

public boolean isListenerForSource(java.lang.Object source)
Only listens to UIInput components which have a BeanValidator assigned.

Specified by:
isListenerForSource in interface javax.faces.event.SystemEventListener

processEvent

public void processEvent(javax.faces.event.SystemEvent event)
                  throws javax.faces.event.AbortProcessingException
Handle the PreValidateEvent and PostValidateEvent.

Specified by:
processEvent in interface javax.faces.event.SystemEventListener
Throws:
javax.faces.event.AbortProcessingException