org.jbeans
Class ReflectionException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--org.jbeans.ReflectionException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- BeanException
- public class ReflectionException
- extends Exception
This class is a generic reflection exception that is to be used to wrap
up any exceptions that are thrown from the java.lang.Class methods and
java.lang.reflect.Method methods.
- Author:
- Brian Pontarelli
- See Also:
- Serialized Form
Method Summary |
Exception |
getRootCause()
Returns the root cause exception which is any exception that can be thrown
while doing reflective operations. |
Throwable |
getTarget()
Returns the target exception which is any exception that was thrown when a method
was invoked using reflection. |
String |
toFullString()
Returns the full string of the exception as described by Throwable.toString()
and also appends |
ReflectionException
public ReflectionException()
- Constructs a new empty reflection exception
ReflectionException
public ReflectionException(String msg)
- Constructs a new reflection exception with the given error message
ReflectionException
public ReflectionException(String msg,
Exception root)
- Constructs a new reflection exception with the given error message and given
root cause exception. The root cause exception is basically the same as the
new JDK 1.4 exception stack. So, this method will need to be re-implemented
in 1.4. The exceptions that are normally used for the root cause are all the
exceptions that occur when doing reflective operations
ReflectionException
public ReflectionException(String msg,
Exception root,
Throwable target)
- Constructs a new reflection exception with the given error message and given
root cause exception. The root cause exception is basically the same as the
new JDK 1.4 exception stack. So, this method will need to be re-implemented
in 1.4. The exceptions that are normally used for the root cause are all the
exceptions that occur when doing reflective operations. The second exception
parameter is the target exception. This is the exception that is thrown from
method that is invoked using the the
ReflectionTools#invokeMethod(
java.lang.reflect.Method, Object, Object [])
. That is, if the method invoked
threw any exception, that exception would be contained here. See the javadoc
for the invokeMethod method for more information.
getRootCause
public Exception getRootCause()
- Returns the root cause exception which is any exception that can be thrown
while doing reflective operations. Such as, IllegalAccessException,
SecurityException, etc.
getTarget
public Throwable getTarget()
- Returns the target exception which is any exception that was thrown when a method
was invoked using reflection.
- Returns:
- The Exception that was thrown from a Method invocation
toFullString
public String toFullString()
- Returns the full string of the exception as described by Throwable.toString()
and also appends