org.apache.commons.lang
Class NotImplementedException
UnsupportedOperationException
org.apache.commons.lang.NotImplementedException
- Nestable
public class NotImplementedException
extends UnsupportedOperationException
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);
}
}
$Id: NotImplementedException.java 161243 2005-04-14 04:30:28Z ggregory $- Matthew Hawthorne
- Stephen Colebourne
NotImplementedException() - Constructs a new
NotImplementedException with default message.
|
NotImplementedException(Class clazz) - Constructs a new
NotImplementedException referencing
the specified class.
|
NotImplementedException(String msg) - Constructs a new
NotImplementedException with specified
detail message.
|
NotImplementedException(String msg, Throwable cause) - Constructs a new
NotImplementedException with specified
detail message and nested Throwable .
|
NotImplementedException(Throwable cause) - Constructs a new
NotImplementedException with specified
nested Throwable and default message.
|
Throwable | getCause() - Gets the root cause of this exception.
|
String | getMessage() - Gets the combined the error message of this and any nested errors.
|
String | getMessage(int index) - Returns the error message of the
Throwable in the chain
of Throwable s at the specified index, numbered from 0.
|
String[] | getMessages() - Returns the error message of this and any nested
Throwable objects.
|
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 .
|
Throwable[] | getThrowables() - Returns this
Nestable and any nested Throwable s
in an array of Throwable s, one element for each
Throwable .
|
int | indexOfThrowable(Class type) - Returns the index of the first occurrence of the specified type.
|
int | indexOfThrowable(Class type, int fromIndex) - Returns the index of the first occurrence of the specified type starting
from the specified index.
|
void | printPartialStackTrace(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(PrintStream out) - Prints the stack trace of this exception to the specified stream.
|
void | printStackTrace(PrintWriter out) - Prints the stack trace of this exception to the specified writer.
|
NotImplementedException
public NotImplementedException()
Constructs a new NotImplementedException
with default message.
NotImplementedException
public NotImplementedException(Class clazz)
Constructs a new NotImplementedException
referencing
the specified class.
clazz
- the Class
that has not implemented the method
NotImplementedException
public NotImplementedException(String msg)
Constructs a new NotImplementedException
with specified
detail message.
NotImplementedException
public NotImplementedException(String msg,
Throwable cause)
Constructs a new NotImplementedException
with specified
detail message and nested Throwable
.
msg
- the error messagecause
- the exception that caused this exception to be thrown
NotImplementedException
public NotImplementedException(Throwable cause)
Constructs a new NotImplementedException
with specified
nested Throwable
and default message.
cause
- the exception that caused this exception to be thrown
getCause
public Throwable getCause()
Gets the root cause of this exception.
- getCause in interface Nestable
- the root cause of this exception.
getMessage
public String getMessage()
Gets the combined the error message of this and any nested errors.
- getMessage in interface Nestable
getMessage
public String getMessage(int index)
Returns the error message of the 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
- the error message, or null if the
Throwable
at the
specified index in the chain does not contain a message
getMessages
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
.
- getMessages in interface Nestable
getThrowable
public Throwable getThrowable(int index)
Returns the Throwable
in the chain by index.
- getThrowable in interface Nestable
index
- the index to retrieve
getThrowableCount
public int getThrowableCount()
Returns the number of nested Throwable
s represented by
this Nestable
, including this Nestable
.
- getThrowableCount in interface Nestable
getThrowables
public Throwable[] getThrowables()
Returns this Nestable
and any nested Throwable
s
in an array of Throwable
s, one element for each
Throwable
.
- getThrowables in interface Nestable
indexOfThrowable
public int indexOfThrowable(Class type)
Returns the index of the first occurrence of the specified type.
If there is no match, -1
is returned.
- indexOfThrowable in interface Nestable
type
- the type to search for
- index of the first occurrence of the type in the chain, or -1 if
the type is not found
indexOfThrowable
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.
- indexOfThrowable in interface Nestable
type
- the type to search forfromIndex
- the index of the starting position in the chain to be searched
- index of the first occurrence of the type in the chain, or -1 if
the type is not found
printPartialStackTrace
public final void printPartialStackTrace(PrintWriter out)
Prints the stack trace for this exception only (root cause not included)
using the specified writer.
- printPartialStackTrace in interface Nestable
out
- the writer to write to
printStackTrace
public void printStackTrace()
Prints the stack trace of this exception.
Includes information from the exception, if any, which caused this exception.
printStackTrace
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.
- printStackTrace in interface Nestable
out
- the stream to write to
printStackTrace
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.
- printStackTrace in interface Nestable
out
- the writer to write to
Copyright © 2001-2005 - Apache Software Foundation