001 /******************************************************************************* 002 * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian 003 * Thomschke. 004 * 005 * All Rights Reserved. This program and the accompanying materials 006 * are made available under the terms of the Eclipse Public License v1.0 007 * which accompanies this distribution, and is available at 008 * http://www.eclipse.org/legal/epl-v10.html 009 * 010 * Contributors: 011 * Sebastian Thomschke - initial implementation. 012 *******************************************************************************/ 013 package net.sf.oval.constraint.exclusion; 014 015 import net.sf.oval.Check; 016 import net.sf.oval.Validator; 017 import net.sf.oval.configuration.annotation.AbstractAnnotationCheckExclusion; 018 import net.sf.oval.constraint.NotNullCheck; 019 import net.sf.oval.context.OValContext; 020 import net.sf.oval.exception.OValException; 021 022 /** 023 * @author Sebastian Thomschke 024 */ 025 public class NullableExclusion extends AbstractAnnotationCheckExclusion<Nullable> 026 { 027 private static final long serialVersionUID = 1L; 028 029 /** 030 * {@inheritDoc} 031 */ 032 public boolean isCheckExcluded(final Check check, final Object validatedObject, final Object valueToValidate, 033 final OValContext context, final Validator validator) throws OValException 034 { 035 return check instanceof NotNullCheck; 036 } 037 }