/* ===================================================================
 * IgnoreValidation.java
 * 
 * Created Feb 24, 2005 12:23:57 PM
 * 
 * Copyright (c) 2005 Matt Magoffin (spamsqr@msqr.us)
 * 
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License as 
 * published by the Free Software Foundation; either version 2 of 
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
 * 02111-1307 USA
 * ===================================================================
 * $Id: IgnoreValidation.java 26 2009-05-03 23:35:54Z msqr $
 * ===================================================================
 */

package magoffin.matt.ieat.util;

import javax.xml.bind.ValidationEvent;
import javax.xml.bind.ValidationEventHandler;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * ValidationEventHandler implementation that simply ignores all 
 * validation events.
 * 
 * @author Matt Magoffin (spamsqr@msqr.us)
 * @version $Revision: 26 $ $Date: 2009-05-04 11:35:54 +1200 (Mon, 04 May 2009) $
 */
public final class IgnoreValidation implements ValidationEventHandler {
	
	/** A static instance of self. */
	public static final IgnoreValidation IGNORE_VALIDATION = new IgnoreValidation();
	
	private final Log logger = LogFactory.getLog(IgnoreValidation.class);
	
	/* (non-Javadoc)
	 * @see javax.xml.bind.ValidationEventHandler#handleEvent(javax.xml.bind.ValidationEvent)
	 */
	public boolean handleEvent(ValidationEvent ve) {
	    if ( logger.isDebugEnabled() ) {
	        logger.debug("ValidationEvent: " +ve.getMessage());
	    }
		return true; // ignore errors, ha ha!
	}
	
}