Save This Page
Home » commons-lang-2.4-src » org.apache.commons » lang » [javadoc | source]
org.apache.commons.lang
public class: NotImplementedException [javadoc | source]
java.lang.Object
   java.lang.Throwable
      java.lang.Exception
         java.lang.RuntimeException
            java.lang.UnsupportedOperationException
               org.apache.commons.lang.NotImplementedException

All Implemented Interfaces:
    Nestable, Serializable

Thrown to indicate that a block of code has not been implemented. This exception supplements UnsupportedOperationException by providing a more semantically rich description of the problem.

NotImplementedException represents the case where the author has yet to implement the logic at this point in the program. This can act as an exception based TODO tag. Because this logic might be within a catch block, this exception suports exception chaining.

public void foo() {
try {
// do something that throws an Exception
} catch (Exception ex) {
// don't know what to do here yet
throw new NotImplementedException("TODO", ex);
}
}
Constructor:
 public NotImplementedException() 
 public NotImplementedException(String msg) 
    Constructs a new NotImplementedException with specified detail message.
    Parameters:
    msg - the error message.
 public NotImplementedException(Throwable cause) 
    Constructs a new NotImplementedException with specified nested Throwable and default message.
    Parameters:
    cause - the exception that caused this exception to be thrown
    since: 2.1 -
 public NotImplementedException(Class clazz) 
    Constructs a new NotImplementedException referencing the specified class.
    Parameters:
    clazz - the Class that has not implemented the method
 public NotImplementedException(String msg,
    Throwable cause) 
    Constructs a new NotImplementedException with specified detail message and nested Throwable.
    Parameters:
    msg - the error message
    cause - the exception that caused this exception to be thrown
    since: 2.1 -
Method from org.apache.commons.lang.NotImplementedException Summary:
getCause,   getMessage,   getMessage,   getMessages,   getThrowable,   getThrowableCount,   getThrowables,   indexOfThrowable,   indexOfThrowable,   printPartialStackTrace,   printStackTrace,   printStackTrace,   printStackTrace
Methods from java.lang.Throwable:
fillInStackTrace,   getCause,   getLocalizedMessage,   getMessage,   getStackTrace,   initCause,   printStackTrace,   printStackTrace,   printStackTrace,   setStackTrace,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.lang.NotImplementedException Detail:
 public Throwable getCause() 
    Gets the root cause of this exception.
 public String getMessage() 
    Gets the combined the error message of this and any nested errors.
 public String getMessage(int index) 
    Returns the error message of the Throwable in the chain of Throwables at the specified index, numbered from 0.
 public String[] getMessages() 
    Returns the error message of this and any nested Throwable objects. Each throwable returns a message, a null string is included in the array if there is no message for a particular Throwable.
 public Throwable getThrowable(int index) 
    Returns the Throwable in the chain by index.
 public int getThrowableCount() 
    Returns the number of nested Throwables represented by this Nestable, including this Nestable.
 public Throwable[] getThrowables() 
    Returns this Nestable and any nested Throwables in an array of Throwables, one element for each Throwable.
 public int indexOfThrowable(Class type) 
    Returns the index of the first occurrence of the specified type. If there is no match, -1 is returned.
 public int indexOfThrowable(Class type,
    int fromIndex) 
    Returns the index of the first occurrence of the specified type starting from the specified index. If there is no match, -1 is returned.
 public final  void printPartialStackTrace(PrintWriter out) 
    Prints the stack trace for this exception only (root cause not included) using the specified writer.
 public  void printStackTrace() 
    Prints the stack trace of this exception. Includes information from the exception, if any, which caused this exception.
 public  void printStackTrace(PrintStream out) 
    Prints the stack trace of this exception to the specified stream. Includes information from the exception, if any, which caused this exception.
 public  void printStackTrace(PrintWriter out) 
    Prints the stack trace of this exception to the specified writer. Includes information from the exception, if any, which caused this exception.