View Javadoc
1   /*******************************************************************************
2    * Portions created by Sebastian Thomschke are copyright (c) 2005-2011 Sebastian
3    * Thomschke.
4    * 
5    * All Rights Reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    * http://www.eclipse.org/legal/epl-v10.html
9    * 
10   * Contributors:
11   *     Sebastian Thomschke - initial implementation.
12   *******************************************************************************/
13  package net.sf.oval.constraint.exclusion;
14  
15  import net.sf.oval.Check;
16  import net.sf.oval.Validator;
17  import net.sf.oval.configuration.annotation.AbstractAnnotationCheckExclusion;
18  import net.sf.oval.constraint.NotNullCheck;
19  import net.sf.oval.context.OValContext;
20  import net.sf.oval.exception.OValException;
21  
22  /**
23   * @author Sebastian Thomschke
24   */
25  public class NullableExclusion extends AbstractAnnotationCheckExclusion<Nullable>
26  {
27  	private static final long serialVersionUID = 1L;
28  
29  	/**
30  	 * {@inheritDoc}
31  	 */
32  	public boolean isCheckExcluded(final Check check, final Object validatedObject, final Object valueToValidate,
33  			final OValContext context, final Validator validator) throws OValException
34  	{
35  		return check instanceof NotNullCheck;
36  	}
37  }