Duck as in duck-typing for an interface like:
interface Get {
Object get(Object key);
}
| Access | Constructor and Description |
|---|---|
| public | DuckGetExecutor(Introspector
the introspector is, Class<?> the class to introspect clazz, Object the property to get identifier)Creates an instance by attempting discovery of the get method. |
| Modifier and Type | Method and Description |
|---|---|
| private static Method | Returns: the method if found, null otherwisethe introspector is, final Class<?> the class to find the get method from clazz, Object the key to use as an argument to the get method identifier)Discovers a method for a |
| public Object | Returns: object.get(property)the object. obj)Implements abstract org. |
| public Object | getTargetProperty()
Overrides org. |
| public Object | tryExecute(Object
The object to get the property from. obj, Object The property to get from the object. key)Overrides org. |
| property | back to summary |
|---|---|
| private final Object property The property. | |
| DuckGetExecutor | back to summary |
|---|---|
| public DuckGetExecutor(Introspector is, Class<?> clazz, Object identifier) Creates an instance by attempting discovery of the get method.
| |
| discover | back to summary |
|---|---|
| private static Method discover(Introspector is, final Class<?> clazz, Object identifier) Discovers a method for a
| |
| execute | back to summary |
|---|---|
| public Object execute(Object obj) throws IllegalAccessException, InvocationTargetException Implements abstract org. Get the property from the 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) Overrides org. Doc from org. Tries to reuse this executor, checking that it is compatible with the actual set of arguments. Compatibility means that:
| |