001 package com.sptci.prevayler.annotations;
002
003 import java.lang.annotation.*;
004
005 /**
006 * An annotation used to indicate that a field in a prevalent object cannot
007 * be null.
008 *
009 * <p>© Copyright 2008 <a href='http://sptci.com/' target='_top'>Sans Pareil Technologies, Inc.</a></p>
010 * @author Rakesh Vidyadharan 2008-05-22
011 * @version $Id: NotNull.java 11 2008-06-30 21:33:41Z sptrakesh $
012 */
013 @Documented
014 @Inherited
015 @Retention( RetentionPolicy.RUNTIME )
016 @Target( { ElementType.TYPE, ElementType.FIELD } )
017 public @interface NotNull
018 {
019 /** A constant to present <code>null</code> or no members. */
020 static final String NULL = "";
021
022 /**
023 * The names of the fields for which the constraint is to be applied. This
024 * is required when annotating a class as opposed to the appropriate fields.
025 *
026 * @return The name of the field in the prevalent object.
027 */
028 String[] members() default NULL;
029 }