org.apache.beehive.controls.api.events
Class EventRef

Object
  extended by EventRef
All Implemented Interfaces:
Serializable

public class EventRef
extends Object
implements Serializable

The EventRef class represents a reference to a specific Control event. EventRefs can be used to fire external events into a Control, in contexts where the event source may not share the associated EventSet class instance with the event target, or even have access to the EventSet class itself.

It is roughly equivalent to the java.lang.reflect.Method object that refers to a method on an EventSet interface, but has several additional properties:

See Also:
Serialized Form

Constructor Summary
EventRef(Method eventMethod)
          Constructs a new EventRef based upon a Method reference.
EventRef(String eventDescriptor)
          Constructs a new EventRef using an event descriptor string.
 
Method Summary
 boolean equals(Object obj)
          Two EventRefs are equal if the method descriptor string associated with them is equal
 String getEventDescriptor(Class controlInterface)
          Returns the event descriptor string associated with the EventRef.
 Method getEventMethod(Class controlInterface)
          Returns the event Method associated with this EventRef.
 String toString()
           
 
Methods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventRef

public EventRef(Method eventMethod)
Constructs a new EventRef based upon a Method reference. The input method must be one that is declared within a Control EventSet interface.

Parameters:
eventMethod - the Method associated with the event

EventRef

public EventRef(String eventDescriptor)
Constructs a new EventRef using an event descriptor string. The format of this string is:
 
      .
 
where eventSet refers to the fully qualified name of the EventSet class, eventName refers to the name of the event Method, and eventDescriptor describes the event argument and return types using the method descriptor format defined in the Java Language Specification.

For example, given the following EventSet interface:

Parameters:
eventDescriptor - the event descriptor string associated with the event
Method Detail

getEventDescriptor

public String getEventDescriptor(Class controlInterface)
Returns the event descriptor string associated with the EventRef.

Parameters:
controlInterface - the ControlInterface

getEventMethod

public Method getEventMethod(Class controlInterface)
Returns the event Method associated with this EventRef.


equals

public boolean equals(Object obj)
Two EventRefs are equal if the method descriptor string associated with them is equal

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object