Duck as in duck-typing for an interface like:
interface Set {
Object set(Object property, Object value);
}
| Access | Constructor and Description |
|---|---|
| public | DuckSetExecutor(Introspector
the introspector is, Class<?> the class to find the set method from clazz, Object the key to use as 1st argument to the set method key, Object the value to use as 2nd argument to the set method value)Creates an instance. |
| Modifier and Type | Method and Description |
|---|---|
| private static Method | |
| public Object | execute(Object
The object to set the property in. obj, Object The value. value)Implements abstract org. |
| public Object | getTargetProperty()
Overrides org. |
| public Object | tryExecute(Object
The object to invoke the method from. obj, Object The property to set in the object. key, Object The value to use as the property value. value)Overrides org. |
| property | back to summary |
|---|---|
| private final Object property The property. | |
| DuckSetExecutor | back to summary |
|---|---|
| public DuckSetExecutor(Introspector is, Class<?> clazz, Object key, Object value) Creates an instance.
| |
| discover | back to summary |
|---|---|
| private static Method discover(Introspector is, Class<?> clazz, Object key, Object value) Discovers the method for a
| |
| execute | back to summary |
|---|---|
| public Object execute(Object obj, Object value) throws IllegalAccessException, InvocationTargetException Implements abstract org. Doc from org. Sets the property value of an object.
| |
| getTargetProperty | back to summary |
|---|---|
| public Object getTargetProperty() Overrides org. Doc from org. Gets the property targeted by this executor. | |
| tryExecute | back to summary |
|---|---|
| public Object tryExecute(Object obj, Object key, Object value) Overrides org. Doc from org. Tries to reuse this executor, checking that it is compatible with the actual set of arguments. Compatibility means that:
| |