|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException java.lang.UnsupportedOperationException org.apache.commons.lang.NotImplementedException
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 Summary | |
NotImplementedException()
Constructs a new NotImplementedException with default message. |
|
NotImplementedException(java.lang.Class clazz)
Constructs a new NotImplementedException referencing the specified class. |
|
NotImplementedException(java.lang.String msg)
Constructs a new NotImplementedException with specified
detail message. |
|
NotImplementedException(java.lang.String msg,
java.lang.Throwable cause)
Constructs a new NotImplementedException with specified
detail message and nested Throwable . |
|
NotImplementedException(java.lang.Throwable cause)
Constructs a new NotImplementedException with specified
nested Throwable and default message. |
Method Summary | |
java.lang.Throwable |
getCause()
Gets the root cause of this exception. |
java.lang.String |
getMessage()
Gets the combined the error message of this and any nested errors. |
java.lang.String |
getMessage(int index)
Returns the error message of the Throwable in the chain
of Throwable s at the specified index, numbered from 0. |
java.lang.String[] |
getMessages()
Returns the error message of this and any nested Throwable objects. |
java.lang.Throwable |
getThrowable(int index)
Returns the Throwable in the chain by index. |
int |
getThrowableCount()
Returns the number of nested Throwable s represented by
this Nestable , including this Nestable . |
java.lang.Throwable[] |
getThrowables()
Returns this Nestable and any nested Throwable s
in an array of Throwable s, one element for each
Throwable . |
int |
indexOfThrowable(java.lang.Class type)
Returns the index of the first occurrence of the specified type. |
int |
indexOfThrowable(java.lang.Class type,
int fromIndex)
Returns the index of the first occurrence of the specified type starting from the specified index. |
void |
printPartialStackTrace(java.io.PrintWriter out)
Prints the stack trace for this exception only (root cause not included) using the specified writer. |
void |
printStackTrace()
Prints the stack trace of this exception. |
void |
printStackTrace(java.io.PrintStream out)
Prints the stack trace of this exception to the specified stream. |
void |
printStackTrace(java.io.PrintWriter out)
Prints the stack trace of this exception to the specified writer. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NotImplementedException()
NotImplementedException
with default message.
public NotImplementedException(java.lang.String msg)
NotImplementedException
with specified
detail message.
msg
- the error message.public NotImplementedException(java.lang.Throwable cause)
NotImplementedException
with specified
nested Throwable
and default message.
cause
- the exception that caused this exception to be thrownpublic NotImplementedException(java.lang.String msg, java.lang.Throwable cause)
NotImplementedException
with specified
detail message and nested Throwable
.
msg
- the error messagecause
- the exception that caused this exception to be thrownpublic NotImplementedException(java.lang.Class clazz)
NotImplementedException
referencing the specified class.
clazz
- the Class
that has not implemented the methodMethod Detail |
public java.lang.Throwable getCause()
getCause
in interface Nestable
public java.lang.String getMessage()
getMessage
in interface Nestable
public java.lang.String getMessage(int index)
Throwable
in the chain
of Throwable
s at the specified index, numbered from 0.
getMessage
in interface Nestable
index
- the index of the Throwable
in the chain
Throwable
at the
specified index in the chain does not contain a message
java.lang.IndexOutOfBoundsException
- if the index
argument is
negative or not less than the count of Throwable
s in the chainpublic java.lang.String[] getMessages()
Throwable
objects.
Each throwable returns a message, a null string is included in the array if
there is no message for a particular Throwable
.
getMessages
in interface Nestable
public java.lang.Throwable getThrowable(int index)
Throwable
in the chain by index.
getThrowable
in interface Nestable
index
- the index to retrieve
Throwable
java.lang.IndexOutOfBoundsException
- if the index
argument is
negative or not less than the count of Throwable
s in the chainpublic int getThrowableCount()
Throwable
s represented by
this Nestable
, including this Nestable
.
getThrowableCount
in interface Nestable
public java.lang.Throwable[] getThrowables()
Nestable
and any nested Throwable
s
in an array of Throwable
s, one element for each
Throwable
.
getThrowables
in interface Nestable
Throwable
spublic int indexOfThrowable(java.lang.Class type)
-1
is returned.
indexOfThrowable
in interface Nestable
type
- the type to search for
public int indexOfThrowable(java.lang.Class type, int fromIndex)
-1
is returned.
indexOfThrowable
in interface Nestable
type
- the type to search forfromIndex
- the index of the starting position in the chain to be searched
java.lang.IndexOutOfBoundsException
- if the fromIndex
argument
is negative or not less than the count of Throwable
s in the chainpublic void printStackTrace()
public void printStackTrace(java.io.PrintStream out)
printStackTrace
in interface Nestable
out
- the stream to write topublic void printStackTrace(java.io.PrintWriter out)
printStackTrace
in interface Nestable
out
- the writer to write topublic final void printPartialStackTrace(java.io.PrintWriter out)
printPartialStackTrace
in interface Nestable
out
- the writer to write to
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |