net.sf.qualitycheck
Annotation Type ArgumentsChecked


@Retention(value=RUNTIME)
@Target(value={CONSTRUCTOR,METHOD})
public @interface ArgumentsChecked

Indicates that a method is intended to check all its arguments using Quality-Check. If a method is annotated with this annotation the method is responsible to check all arguments against basic conditions like not null, not empty etc.

In turn the caller has to be aware that exceptions like IllegalNullArgumentException will be thrown by the method if input arguments are not valid.

The following example describes how to use it.

 @ArgumentsChecked
 public void validate(Object o) {
        Check.notNull(o);
 }
 

Additionally it can be documented which exceptions may occur if given arguments are invalid using the additional annotation @Throws.

 @ArgumentsChecked
 @Throws(IllegalNullArgumentException.class)
 public void validate(Object o) {
        Check.notNull(o);
 }
 

Author:
André Rouél, Dominik Seichter



Copyright © 2012-2013. All Rights Reserved.