|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.taursys.xml.Component
This is the foundation object for MapperXML components. All components share this base abstract class. It provides common attributes and basic event dispatching methods with limited implementation.
This object defines the following properties:
parent
- the parent Container
for this
Component
. This property is set by the Container
methods: add
and remove
.
visible
- this property is used by render subcomponents to
determine whether to hide or show this component during rendering.
This object is designed to respond to 5 types of events. The following are the events this component is designed to respond to:
ParameterEvent
- this event is generated when parameter
values are available for this component. A ParameterEvent
differs from an InputEvent
only by WHEN it is dispatched.
ParameterEvents
are normally dispatched before
InputEvents
InputEvent
- this event is generated when input
values are available for this component. An InputEvent
differs from a ParameterEvent
only by WHEN it is dispatched.
InputEvents
are normally dispatched after
ParameterEvents
TriggerEvent
- this event is generated when a specific
name/value pair appears (or does not appear) in the request.
RenderEvent
- this event is generated when it is time
for components to render their value to the document.
RecycleEvent
- this event is generated after the
request/response cycle as a signal that components should return to a
default or initial state. Components may also modify the document as
part of their response to this event.
In order to be notified of these events, this component must register
with each of the appropriate dispatchers. This is done by adding/removing
the types of events you wish to be notified of to the eventTypeList
.
This is done by invoking the addEventType
or
removeEventType
method with the fully qualified class name
of the desired event. The eventTypeList
is used by the
addNotify
and removeNotify
methods which are
invoked by the Container
during the add
and
remove
Container
methods.
This component contains a 2 general purpose methods modeled after
AWT and Swing: dispatchEvent
and processEvent
.
These 2 methods simply call the specific processXXXEvent method based
on the event type.
For each of the specific event types, there are a set of 3 related methods.
processXXXEvent
- this method is where you would provide
the necessary behavior to respond to the event. This abstract implementation
simply propagates the event to registered listeners. You should override
this method to provide appropriate behavior.
addXXXListener
- registers the given listener with this
component to be notified whenever this component has began/ended processing
the event.
removeXXXListener
- unregisters the given listener so it
will no longer be notified.
Constructor Summary | |
Component()
Constructs a component |
Method Summary | |
protected void |
addEventType(java.lang.String eventType)
Adds the given eventType to the event type list. |
void |
addInputListener(InputListener l)
Adds given listener to notification list for InputEvents |
void |
addNotify()
Registers this component with dispatcher to be notified of ParameterEvents This method invokes the lazyAddNotify method to perform the work |
void |
addParameterListener(ParameterListener l)
Adds given listener to notification list for ParameterEvents |
void |
addRecycleListener(RecycleListener l)
Adds given listener to notification list for RecycleEvents |
void |
addRenderListener(RenderListener l)
Adds given listener to notification list for RenderEvents |
void |
addTriggerListener(TriggerListener l)
Adds given listener to notification list for TriggerEvents |
void |
dispatchEvent(java.util.EventObject e)
Dispatches an event to this component or one of its subcomponents. |
protected void |
fireActionPerformed(TriggerEvent e)
Notifies all registered listeners of a given TriggerEvent |
protected void |
fireInputReceived(InputEvent e)
Notifies all registered listeners of a given InputEvent |
protected void |
fireParameterReceived(ParameterEvent e)
Notifies all registered listeners of a given ParameterEvent |
protected void |
fireRecycle(RecycleEvent e)
Notifies all registered listeners of a given RecycleEvent |
protected void |
fireRender(RenderEvent e)
Notifies all registered listeners of a given RenderEvent |
protected java.util.ArrayList |
getEventTypeList()
Returns the list of event types that this component responds to |
Container |
getParent()
Returns the parent container of this component else null. |
protected boolean |
isNotifySet()
Gets indicator of whether or not notification has been setup. |
boolean |
isVisible()
Get the indicator whether or not this component should be rendered visible. |
protected void |
lazyAddNotify()
Conditionally registers this component with dispatchers for the event types contained in the eventTypeList . |
protected void |
lazyRemoveNotify()
Conditionally un-registers this component from dispatcher for the event types contained in the eventTypeList . |
protected void |
processEvent(java.util.EventObject e)
Processes given event by invoking the appropriate processX__Event method. |
protected void |
processInputEvent(InputEvent e)
Processes a given InputEvent. |
protected void |
processParameterEvent(ParameterEvent e)
Processes a given ParameterEvent. |
void |
processRecycleEvent(RecycleEvent e)
Processes a given RecycleEvent. |
void |
processRenderEvent(RenderEvent e)
Processes a given RenderEvent. |
protected void |
processTriggerEvent(TriggerEvent e)
Processes a given TriggerEvent. |
protected void |
removeEventType(java.lang.String eventType)
Removes the given eventType from the event type list. |
void |
removeInputListener(InputListener l)
Removes given listener from notification list for InputEvents |
void |
removeNotify()
Un-Registers this component with dispatcher. |
void |
removeParameterListener(ParameterListener l)
Removes given listener from notification list for ParameterEvents |
void |
removeRecycleListener(RecycleListener l)
Removes given listener from notification list for RecycleEvents |
void |
removeRenderListener(RenderListener l)
Removes given listener from notification list for RenderEvents |
void |
removeTriggerListener(TriggerListener l)
Removes given listener from notification list for TriggerEvents |
void |
setVisible(boolean visible)
Set the indicator whether or not this component should be rendered visible. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Component()
Method Detail |
public Container getParent()
public void setVisible(boolean visible)
visible
- the indicator whether or not this component should be rendered visible.public boolean isVisible()
protected java.util.ArrayList getEventTypeList()
protected void removeEventType(java.lang.String eventType)
eventType
from the event type list.
The event type list is used by addNotify
and
removeNotify
methods to register/un-register with
Dispatchers
for events. The eventType
is the
fully qualified class name of the event. This method does not
re-register with Dispatchers
. You must invoke the
addNotify
and removeNotify
methods to
register with Dispatchers
.
eventType
- fully qualified class name of the Eventprotected void addEventType(java.lang.String eventType)
eventType
to the event type list.
The event type list is used by addNotify
and
removeNotify
methods to register/un-register with
Dispatchers
for events. The eventType
is the
fully qualified class name of the event. This method does not
re-register with Dispatchers
. You must invoke the
addNotify
and removeNotify
methods to
register with Dispatchers
.
eventType
- fully qualified class name of the Eventpublic void addNotify()
public void removeNotify()
protected void lazyAddNotify()
eventTypeList
. In order to be notified, this
component must have a parent and the notifySet flag must be false.
protected void lazyRemoveNotify()
eventTypeList
.
Only un-registers if it WAS registered and parent is not null.
protected boolean isNotifySet()
public void dispatchEvent(java.util.EventObject e) throws java.lang.Exception
java.lang.Exception
protected void processEvent(java.util.EventObject e) throws java.lang.Exception
java.lang.Exception
protected void processParameterEvent(ParameterEvent e) throws java.lang.Exception
java.lang.Exception
public void removeParameterListener(ParameterListener l)
public void addParameterListener(ParameterListener l)
protected void fireParameterReceived(ParameterEvent e) throws java.lang.Exception
java.lang.Exception
protected void processInputEvent(InputEvent e) throws java.lang.Exception
java.lang.Exception
public void removeInputListener(InputListener l)
public void addInputListener(InputListener l)
protected void fireInputReceived(InputEvent e) throws java.lang.Exception
java.lang.Exception
public void processRenderEvent(RenderEvent e) throws RenderException
e
- the RenderEvent to process
RenderException
- for any problems during renderingpublic void removeRenderListener(RenderListener l)
public void addRenderListener(RenderListener l)
protected void fireRender(RenderEvent e) throws RenderException
RenderException
protected void processTriggerEvent(TriggerEvent e) throws java.lang.Exception
java.lang.Exception
public void removeTriggerListener(TriggerListener l)
public void addTriggerListener(TriggerListener l)
protected void fireActionPerformed(TriggerEvent e) throws java.lang.Exception
java.lang.Exception
public void processRecycleEvent(RecycleEvent e) throws RecycleException
e
- the RecycleEvent to process
RecycleException
- for any problems during recycleingpublic void removeRecycleListener(RecycleListener l)
public void addRecycleListener(RecycleListener l)
protected void fireRecycle(RecycleEvent e) throws RecycleException
RecycleException
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |