org.schmant.support
Class AbstractArgumentChecker

java.lang.Object
  extended by org.schmant.support.AbstractArgumentChecker
Direct Known Subclasses:
AbstractCustomDocletDecorator, AbstractExtJavaTaskDecorator, AbstractStandardDocletDecorator, AbstractTask, ChangeExtensionTargetStrategy, DirectoryAndFilter, DirectoryRepresentation, EclipseProjectClasspathInfo, EclipseProjectInfo, EclipseWorkspaceSettings, EntityAndAbsoluteLocation, FutureEntity, IntelliJWorkspaceSettings, JavadocTagDefinition, JavaProjectClasspathDecorator, JavaProjectDependencies, JUnit4AntXmlReporter, JUnit4TestSuiteReporter, Library, RenamedFile, XmlCatalogResolver

public abstract class AbstractArgumentChecker
extends Object

This class can be inherited by classes that want to check arguments to their methods.

Since:
0.5
Author:
Karl Gustafsson

Constructor Summary
AbstractArgumentChecker()
           
 
Method Summary
protected  void check(Collection<?> c)
          Check that the argument is not null and that it does not contain any null elements.
protected  void check(Map<?,?> m)
          Check that the argument is not null and that the map does not contain any null keys.
protected  void check(Object... os)
           
protected  void check(Object o)
          Check that the argument is not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractArgumentChecker

public AbstractArgumentChecker()
Method Detail

check

protected void check(Object o)
              throws InvalidArgumentException
Check that the argument is not null.

Parameters:
o - May not be null
Throws:
InvalidArgumentException - If the argument is null.

check

protected void check(Collection<?> c)
              throws InvalidArgumentException
Check that the argument is not null and that it does not contain any null elements.

Parameters:
c - A collection
Throws:
InvalidArgumentException - If the collection does not pass the validation.

check

protected void check(Map<?,?> m)
              throws InvalidArgumentException
Check that the argument is not null and that the map does not contain any null keys. (Null values are permitted.)

Parameters:
m - A map
Throws:
InvalidArgumentException - If the map does not pass the validation.

check

protected void check(Object... os)