/**
 * 
 */
package org.richfaces.event;

import javax.faces.component.UIComponent;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;


/**
 * @author asmirnov
 *
 */
public class ValidationEvent extends FacesEvent {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5593837134704144777L;

	public ValidationEvent(UIComponent component) {
		super(component);
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
	 */
	@Override
	public boolean isAppropriateListener(FacesListener listener) {
		// TODO Auto-generated method stub
		return listener instanceof ValidationListener;
	}

	/* (non-Javadoc)
	 * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
	 */
	@Override
	public void processListener(FacesListener listener) {
		if (listener instanceof ValidationListener) {
			ValidationListener validationListener = (ValidationListener) listener;
			validationListener.processValidation(this);
		}

	}

}
