Package org.apache.commons.lang
Class NotImplementedException
- java.lang.Object
 - 
- java.lang.Throwable
 - 
- java.lang.Exception
 - 
- java.lang.RuntimeException
 - 
- java.lang.UnsupportedOperationException
 - 
- org.apache.commons.lang.NotImplementedException
 
 
 
 
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable,Nestable
public class NotImplementedException extends java.lang.UnsupportedOperationException implements Nestable
Thrown to indicate that a block of code has not been implemented. This exception supplements
UnsupportedOperationExceptionby providing a more semantically rich description of the problem.NotImplementedExceptionrepresents 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); } }- Since:
 - 2.0
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description NotImplementedException()Constructs a newNotImplementedExceptionwith default message.NotImplementedException(java.lang.Class clazz)Constructs a newNotImplementedExceptionreferencing the specified class.NotImplementedException(java.lang.String msg)Constructs a newNotImplementedExceptionwith specified detail message.NotImplementedException(java.lang.String msg, java.lang.Throwable cause)Constructs a newNotImplementedExceptionwith specified detail message and nestedThrowable.NotImplementedException(java.lang.Throwable cause)Constructs a newNotImplementedExceptionwith specified nestedThrowableand default message. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ThrowablegetCause()Gets the root cause of this exception.java.lang.StringgetMessage()Gets the combined the error message of this and any nested errors.java.lang.StringgetMessage(int index)Returns the error message of theThrowablein the chain ofThrowables at the specified index, numbered from 0.java.lang.String[]getMessages()Returns the error message of this and any nestedThrowableobjects.java.lang.ThrowablegetThrowable(int index)Returns theThrowablein the chain by index.intgetThrowableCount()Returns the number of nestedThrowables represented by thisNestable, including thisNestable.java.lang.Throwable[]getThrowables()Returns thisNestableand any nestedThrowables in an array ofThrowables, one element for eachThrowable.intindexOfThrowable(java.lang.Class type)Returns the index of the first occurrence of the specified type.intindexOfThrowable(java.lang.Class type, int fromIndex)Returns the index of the first occurrence of the specified type starting from the specified index.voidprintPartialStackTrace(java.io.PrintWriter out)Prints the stack trace for this exception only (root cause not included) using the specified writer.voidprintStackTrace()Prints the stack trace of this exception.voidprintStackTrace(java.io.PrintStream out)Prints the stack trace of this exception to the specified stream.voidprintStackTrace(java.io.PrintWriter out)Prints the stack trace of this exception to the specified writer. 
 - 
 
- 
- 
Constructor Detail
- 
NotImplementedException
public NotImplementedException()
Constructs a newNotImplementedExceptionwith default message.- Since:
 - 2.1
 
 
- 
NotImplementedException
public NotImplementedException(java.lang.String msg)
Constructs a newNotImplementedExceptionwith specified detail message.- Parameters:
 msg- the error message.
 
- 
NotImplementedException
public NotImplementedException(java.lang.Throwable cause)
Constructs a newNotImplementedExceptionwith specified nestedThrowableand default message.- Parameters:
 cause- the exception that caused this exception to be thrown- Since:
 - 2.1
 
 
- 
NotImplementedException
public NotImplementedException(java.lang.String msg, java.lang.Throwable cause)Constructs a newNotImplementedExceptionwith specified detail message and nestedThrowable.- Parameters:
 msg- the error messagecause- the exception that caused this exception to be thrown- Since:
 - 2.1
 
 
- 
NotImplementedException
public NotImplementedException(java.lang.Class clazz)
Constructs a newNotImplementedExceptionreferencing the specified class.- Parameters:
 clazz- theClassthat has not implemented the method
 
 - 
 
- 
Method Detail
- 
getCause
public java.lang.Throwable getCause()
Gets the root cause of this exception. 
- 
getMessage
public java.lang.String getMessage()
Gets the combined the error message of this and any nested errors.- Specified by:
 getMessagein interfaceNestable- Overrides:
 getMessagein classjava.lang.Throwable- Returns:
 - the error message
 - Since:
 - 2.1
 
 
- 
getMessage
public java.lang.String getMessage(int index)
Returns the error message of theThrowablein the chain ofThrowables at the specified index, numbered from 0.- Specified by:
 getMessagein interfaceNestable- Parameters:
 index- the index of theThrowablein the chain- Returns:
 - the error message, or null if the 
Throwableat the specified index in the chain does not contain a message - Throws:
 java.lang.IndexOutOfBoundsException- if theindexargument is negative or not less than the count ofThrowables in the chain- Since:
 - 2.1
 
 
- 
getMessages
public java.lang.String[] getMessages()
Returns the error message of this and any nestedThrowableobjects. Each throwable returns a message, a null string is included in the array if there is no message for a particularThrowable.- Specified by:
 getMessagesin interfaceNestable- Returns:
 - the error messages
 - Since:
 - 2.1
 
 
- 
getThrowable
public java.lang.Throwable getThrowable(int index)
Returns theThrowablein the chain by index.- Specified by:
 getThrowablein interfaceNestable- Parameters:
 index- the index to retrieve- Returns:
 - the 
Throwable - Throws:
 java.lang.IndexOutOfBoundsException- if theindexargument is negative or not less than the count ofThrowables in the chain- Since:
 - 2.1
 
 
- 
getThrowableCount
public int getThrowableCount()
Returns the number of nestedThrowables represented by thisNestable, including thisNestable.- Specified by:
 getThrowableCountin interfaceNestable- Returns:
 - the throwable count
 - Since:
 - 2.1
 
 
- 
getThrowables
public java.lang.Throwable[] getThrowables()
Returns thisNestableand any nestedThrowables in an array ofThrowables, one element for eachThrowable.- Specified by:
 getThrowablesin interfaceNestable- Returns:
 - the 
Throwables - Since:
 - 2.1
 
 
- 
indexOfThrowable
public int indexOfThrowable(java.lang.Class type)
Returns the index of the first occurrence of the specified type. If there is no match,-1is returned.- Specified by:
 indexOfThrowablein interfaceNestable- Parameters:
 type- the type to search for- Returns:
 - index of the first occurrence of the type in the chain, or -1 if the type is not found
 - Since:
 - 2.1
 
 
- 
indexOfThrowable
public int indexOfThrowable(java.lang.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,-1is returned.- Specified by:
 indexOfThrowablein interfaceNestable- Parameters:
 type- the type to search forfromIndex- the index of the starting position in the chain to be searched- Returns:
 - index of the first occurrence of the type in the chain, or -1 if the type is not found
 - Throws:
 java.lang.IndexOutOfBoundsException- if thefromIndexargument is negative or not less than the count ofThrowables in the chain- Since:
 - 2.1
 
 
- 
printStackTrace
public void printStackTrace()
Prints the stack trace of this exception. Includes information from the exception, if any, which caused this exception.- Overrides:
 printStackTracein classjava.lang.Throwable- Since:
 - 2.1
 
 
- 
printStackTrace
public void printStackTrace(java.io.PrintStream out)
Prints the stack trace of this exception to the specified stream. Includes information from the exception, if any, which caused this exception.- Specified by:
 printStackTracein interfaceNestable- Overrides:
 printStackTracein classjava.lang.Throwable- Parameters:
 out- the stream to write to- Since:
 - 2.1
 
 
- 
printStackTrace
public void printStackTrace(java.io.PrintWriter out)
Prints the stack trace of this exception to the specified writer. Includes information from the exception, if any, which caused this exception.- Specified by:
 printStackTracein interfaceNestable- Overrides:
 printStackTracein classjava.lang.Throwable- Parameters:
 out- the writer to write to- Since:
 - 2.1
 
 
- 
printPartialStackTrace
public final void printPartialStackTrace(java.io.PrintWriter out)
Prints the stack trace for this exception only (root cause not included) using the specified writer.- Specified by:
 printPartialStackTracein interfaceNestable- Parameters:
 out- the writer to write to- Since:
 - 2.1
 
 
 - 
 
 -