All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sunw.demo.encapsulatedEvents.EncapsulatedEvent

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----sunw.demo.encapsulatedEvents.EncapsulatedEvent

public class EncapsulatedEvent
extends EventObject

The EncapsulatedEvent class is a subclass of java.util.EventObject and is designed as part of a package sun.demo.encapsulatedEvents to demonstrate the dynamic generation of JavaBeans Event Adaptor classes, and also a technique for creating a polymorphic event processing model as an extension of the existing JavaBeans Event Model.

See Also:
EncapsulatedEventAdaptor, EncapsulatedEventListener, EncapsulatedEventAdaptorGenerator, EncapsulatedEventException

Variable Index

 o event
 o eventArgs
 o listenerInterface
 o listenerMethod

Constructor Index

 o EncapsulatedEvent(EventObject, Method)

Construct an Event Object from a simple event listener method.

 o EncapsulatedEvent(Object, EventObject, Method)

Construct an Event Object from an intermediate.

 o EncapsulatedEvent(Object, EventObject, Method, Object[])

Construct an EncapsulatedEvent object.

 o EncapsulatedEvent(Object, Method, Object[])

Construct an Event Object from a cracked event listener method.

Method Index

 o deliverEvent(EventListener)

This method can be used to deliver the encapsulated event to an object that conforms to the EventListener sub-interface that the event originated from.

 o getEvent()
 o getEventArguments()
 o getEventClass()
 o getEventClassName()
 o getEventSource()
 o getListenerInterface()
 o getListenerInterfaceName()
 o getListenerMethod()
 o getListenerMethodName()

Variables

 o event
 protected EventObject event
 o listenerMethod
 protected Method listenerMethod
 o listenerInterface
 protected Class listenerInterface
 o eventArgs
 protected Object eventArgs[]

Constructors

 o EncapsulatedEvent
 protected EncapsulatedEvent(Object s,
                             EventObject e,
                             Method m,
                             Object a[])

Construct an EncapsulatedEvent object. An EncapsulatedEvent contains a reference to the "actual" event occurring, and the Method/Class from which this "actual" event was fired.

Parameters:
s - The "source" of the "actual" event (may not be null).
e - The "actual" event itself (or null if this is a "cracked" event.
m - The java.lang.reflect.Method describing the Listener method that this event was emitted from.
 o EncapsulatedEvent
 public EncapsulatedEvent(Object s,
                          EventObject e,
                          Method m)

Construct an Event Object from an intermediate.

 o EncapsulatedEvent
 public EncapsulatedEvent(EventObject e,
                          Method m)

Construct an Event Object from a simple event listener method.

 o EncapsulatedEvent
 public EncapsulatedEvent(Object s,
                          Method m,
                          Object a[])

Construct an Event Object from a cracked event listener method.

Methods

 o getEvent
 public EventObject getEvent()
Returns:
The EventObject instance encapsulated or null if from a cracked event.
 o getEventClass
 public Class getEventClass()
Returns:
The java.lang.Class of the EventObject instance encapsulated or null if from a cracked event.
 o getEventClassName
 public String getEventClassName()
Returns:
The String name of the class of the EventObject instance encapsulated or null if from a cracked event.
 o getEventSource
 public Object getEventSource()
Returns:
The source object of the encapsulated EventObject instance.
 o getListenerMethod
 public Method getListenerMethod()
Returns:
the java.lang.reflect.Method of the EventListener Method.
 o getListenerMethodName
 public String getListenerMethodName()
Returns:
the name of the java.lang.reflect.Method of the EventListener Method.
 o getListenerInterface
 public Class getListenerInterface()
Returns:
the Class for the orginating EventListener subinterface
 o getListenerInterfaceName
 public String getListenerInterfaceName()
Returns:
the name of the Class for the orginating EventListener subinterface
 o getEventArguments
 public Object[] getEventArguments()
Returns:
an Object[] of the encapsulated event, if the EventObject is not already in the args, it is inserted by this class at index 0.
 o deliverEvent
 public void deliverEvent(EventListener el) throws InvocationTargetException, IllegalAccessException

This method can be used to deliver the encapsulated event to an object that conforms to the EventListener sub-interface that the event originated from.

Parameters:
el - The EventListener object to deliver the unencapsulated event to.

All Packages  Class Hierarchy  This Package  Previous  Next  Index