net.israfil.foundation.dynamic
Interface Dynamic

All Known Subinterfaces:
DynamicallyAccessible, DynamicallyMutable
All Known Implementing Classes:
DynamicallyAccessibleObject, DynamicallyMutableObject, DynamicObject

public interface Dynamic

A simple interface that defines the ability to perform and detect arbitrary methods, by use of a "selector" string. The selector is a string constructed of a method name and an arbitrary number of classes representing parameter types. These are then concatenated with a ":" separator. The resulting string represents a full method signature, without reference to the implementing class. This allows arbitrary classes to be interrogated as to the validity of a given method call (i.e. do they or their parents implement it). It also then allows the method with the given signature to be invoked. For example: if (a.respondsTo("doThing:java.lang.String")) a.perform("doThing:java.lang.String",aString);

Author:
Christian Edward Gruber

Method Summary
 java.lang.Object perform(java.lang.String selector, java.lang.Object... parameters)
           
 boolean respondsTo(java.lang.String selector)
           
 

Method Detail

perform

java.lang.Object perform(java.lang.String selector,
                         java.lang.Object... parameters)

respondsTo

boolean respondsTo(java.lang.String selector)


Copyright © 2003-2008. All Rights Reserved.