public abstract class ReflectionCode
extends java.lang.Object
hasRun()
indicates whether it has been run.
Implemented by parts of Randoop that want to execute reflection code via ReflectionExecutor.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ReflectionCode.ReflectionCodeException
Indicates a bug in the ReflectionCode class.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.Throwable |
exceptionThrown
The exception thrown by execution.
|
private boolean |
hasRun
Has this been executed already?
|
private boolean |
hasStarted
Has this started execution?
|
protected java.lang.Object |
retval
The value yielded by execution.
|
Constructor and Description |
---|
ReflectionCode() |
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
getExceptionThrown() |
java.lang.Object |
getReturnValue() |
boolean |
hasRun() |
boolean |
hasStarted() |
void |
runReflectionCode()
Runs the reflection code that this object represents.
|
protected abstract void |
runReflectionCodeRaw()
Execute the reflection code.
|
protected void |
setHasRun() |
protected void |
setHasStarted() |
protected java.lang.String |
status()
A suffix to be called by toString().
|
private boolean hasStarted
private boolean hasRun
protected java.lang.Object retval
protected java.lang.Throwable exceptionThrown
public final boolean hasStarted()
public final boolean hasRun()
protected final void setHasStarted()
protected final void setHasRun()
public final void runReflectionCode() throws ReflectionCode.ReflectionCodeException
runReflectionCodeRaw()
to perform the actual work. runReflectionCodeRaw()
sets the retVal
or exceptionThrown
field, or
throws an exception if there is a bug in Randoop.
ReflectionCode.ReflectionCodeException
- if execution results in conflicting error and success states;
this results from a bug in Randoopprotected abstract void runReflectionCodeRaw() throws ReflectionCode.ReflectionCodeException
ReflectionCode.ReflectionCodeException
- if execution results in conflicting error and success states;
this results from a bug in Randooppublic java.lang.Object getReturnValue()
public java.lang.Throwable getExceptionThrown()
protected java.lang.String status()