Statement
object represents a primitive statement
in which a single method is applied to a target and
a set of arguments - as in "a.setFoo(b)"
.
Note that where this example uses names
to denote the target and its argument, a statement
object does not require a name space and is constructed with
the values themselves.
The statement object associates the named method
with its environment as a simple set of values:
the target and an array of argument values.
Modifier and Type | Field and Description |
---|---|
private final AccessControlContext | acc
Deprecated
as a consequence of
AccessControlContext being deprecated.
|
private final Object[] | |
pack-priv static ExceptionListener | |
private static Object[] | |
pack-priv ClassLoader | |
private final String | |
private final Object |
Access | Constructor and Description |
---|---|
public | Statement(Object
the target object of this statement target, String the name of the method to invoke on the specified target methodName, Object[] the array of arguments to invoke the specified method arguments)Creates a new |
Modifier and Type | Method and Description |
---|---|
public void | execute()
The |
public Object[] | |
pack-priv static Method | |
public String | |
public Object | |
pack-priv String | |
pack-priv Object | |
private Object | |
public String | toString()
Overrides java. |
acc | back to summary |
---|---|
private final AccessControlContext acc
Deprecated as a consequence of
|
arguments | back to summary |
---|---|
private final Object[] arguments |
defaultExceptionListener | back to summary |
---|---|
pack-priv static ExceptionListener defaultExceptionListener |
emptyArray | back to summary |
---|---|
private static Object[] emptyArray |
loader | back to summary |
---|---|
pack-priv ClassLoader loader |
methodName | back to summary |
---|---|
private final String methodName |
target | back to summary |
---|---|
private final Object target |
Statement | back to summary |
---|---|
public Statement(Object target, String methodName, Object[] arguments) Creates a new
The
|
execute | back to summary |
---|---|
public void execute() throws Exception The The following method types are handled as special cases:
|
getArguments | back to summary |
---|---|
public Object[] getArguments() Returns the arguments for the method to invoke.
The number of arguments and their types
must match the method being called.
|
getMethod | back to summary |
---|---|
pack-priv static Method getMethod(Class<?> type, String name, Class<?>... args) |
getMethodName | back to summary |
---|---|
public String getMethodName() Returns the name of the method to invoke.
If this method returns
|
getTarget | back to summary |
---|---|
public Object getTarget() Returns the target object of this statement.
If this method returns
|
instanceName | back to summary |
---|---|
pack-priv String instanceName(Object instance) |
invoke | back to summary |
---|---|
pack-priv Object invoke() throws Exception
|
invokeInternal | back to summary |
---|---|
private Object invokeInternal() throws Exception |
toString | back to summary |
---|---|
public String toString() Overrides java. Prints the value of this statement using a Java-style syntax.
|