randoop.util
Class ReflectionCode

Object
  extended by ReflectionCode
Direct Known Subclasses:
ConstructorReflectionCode, MethodReflectionCode

public abstract class ReflectionCode
extends Object

Implemented by parts of randoop that want to execute reflection code via ReflectionExecutor.


Constructor Summary
Constructor and Description
ReflectionCode()
           
 
Method Summary
Modifier and Type Method and Description
abstract  Throwable getExceptionThrown()
           
abstract  Object getReturnVariable()
           
 boolean hasRunAlready()
           
 void runReflectionCode()
          Runs the reflection code that this object represents, but first, if System.getSecurityManager() returns a RandoopSecurityManager, this method sets the security manager's status to ON.
protected abstract  void runReflectionCodeRaw()
          Executed the reflection code.
protected  void setRunAlready()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionCode

public ReflectionCode()
Method Detail

runReflectionCode

public final void runReflectionCode()
                             throws InstantiationException,
                                    IllegalAccessException,
                                    InvocationTargetException,
                                    ReflectionCode.NotCaughtIllegalStateException
Runs the reflection code that this object represents, but first, if System.getSecurityManager() returns a RandoopSecurityManager, this method sets the security manager's status to ON. Before exiting, this method sets the security manager's status to its status before this call.

Throws:
InstantiationException
IllegalAccessException
InvocationTargetException
ReflectionCode.NotCaughtIllegalStateException

runReflectionCodeRaw

protected abstract void runReflectionCodeRaw()
                                      throws InstantiationException,
                                             IllegalAccessException,
                                             InvocationTargetException,
                                             ReflectionCode.NotCaughtIllegalStateException
Executed the reflection code. All internal exceptions must be thrown as NotCaughtIllegalStateException because everything else is caught.

Throws:
InstantiationException
IllegalAccessException
InvocationTargetException
ReflectionCode.NotCaughtIllegalStateException

setRunAlready

protected final void setRunAlready()

getReturnVariable

public abstract Object getReturnVariable()

getExceptionThrown

public abstract Throwable getExceptionThrown()

hasRunAlready

public final boolean hasRunAlready()