org.apache.commons.lang
Class IncompleteArgumentException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byjava.lang.IllegalArgumentException
                  extended byorg.apache.commons.lang.IncompleteArgumentException
All Implemented Interfaces:
Serializable

public class IncompleteArgumentException
extends IllegalArgumentException

Thrown to indicate an incomplete argument to a method. This exception supplements the standard IllegalArgumentException by providing a more semantically rich description of the problem.

IncompleteArgumentException represents the case where a method takes in a parameter that has a number of properties, some of which have not been set. A case might be a search requirements bean that must have three properties set in order for the method to run, but only one is actually set. This exception would be used in place of IllegalArgumentException, yet it still extends it.

 public void foo(PersonSearcher search) {
   if (search.getSurname() == null ||
       search.getForename() == null ||
       search.getSex() == null) {
     throw new IncompleteArgumentException("search");
   }
   // do something with the searcher
 }
 

Since:
2.0
Version:
$Id: IncompleteArgumentException.java 161243 2005-04-14 04:30:28Z ggregory $
Author:
Matthew Hawthorne
See Also:
Serialized Form

Constructor Summary
IncompleteArgumentException(String argName)
          Instantiates with the specified description.
IncompleteArgumentException(String argName, String[] items)
          Instantiates with the specified description.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IncompleteArgumentException

public IncompleteArgumentException(String argName)

Instantiates with the specified description.

Parameters:
argName - a description of the incomplete argument

IncompleteArgumentException

public IncompleteArgumentException(String argName,
                                   String[] items)

Instantiates with the specified description.

Parameters:
argName - a description of the incomplete argument
items - an array describing the arguments missing


Copyright © 2001-2005 The Apache Software Foundation. All Rights Reserved.