org.jaffa.presentation.portlet
Class FormKey

java.lang.Object
  extended byorg.jaffa.presentation.portlet.FormKey
All Implemented Interfaces:
Cloneable, Comparable, Serializable

public class FormKey
extends Object
implements Cloneable, Comparable, Serializable

This object is returned by the event handlers. It indicates the form to which control should be passed & the corresponding Component's id. Ensure that a 'forward' mapping exists for the formName in the struts-config file. The formName and componentId are immutable properties and can only be passed in the constructor. The title can be set at any time and is mainly for use in the historyNav.jsp, for displaying the history bar links.

See Also:
Serialized Form

Constructor Summary
FormKey(String formName, String componentId)
          Constructs an instance of the FormKey class
 
Method Summary
 Object clone()
          Returns a clone of the object.
 int compareTo(Object obj)
          Compares this object with another FormKey object.
 boolean equals(Object obj)
          Compares this object with another FormKey object.
static FormKey getCloseBrowserFormKey()
          Returns the FormKey that will render the JSP used for closing a browser window.
 String getComponentId()
          Returns the componentId
 String getFormName()
          Returns the formName
 String getTitle()
          Getter for property title.
 int hashCode()
          Returns an int which will be the sum of the of the hashcodes of componentId, formName.
 void setTitle(String title)
          Setter for property title.
 String toString()
          Returns the debug information for the object
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormKey

public FormKey(String formName,
               String componentId)
Constructs an instance of the FormKey class

Parameters:
formName - The formName
componentId - The componentId
Method Detail

getFormName

public String getFormName()
Returns the formName

Returns:
The formName

getComponentId

public String getComponentId()
Returns the componentId

Returns:
The componentId

getTitle

public String getTitle()
Getter for property title.

Returns:
Value of property title.

setTitle

public void setTitle(String title)
Setter for property title.

Parameters:
title - New value of property title.

clone

public Object clone()
Returns a clone of the object.

Returns:
a clone of the object.

compareTo

public int compareTo(Object obj)
Compares this object with another FormKey object. It compares the fields componentId, formName of the 2 objects.

Specified by:
compareTo in interface Comparable
Parameters:
obj - the other FormKey object.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

hashCode

public int hashCode()
Returns an int which will be the sum of the of the hashcodes of componentId, formName.

Returns:
an int which will be the sum of the of the hashcodes of componentId, formName.

equals

public boolean equals(Object obj)
Compares this object with another FormKey object. Returns a true if both the objects have the same formName, componentId.

Parameters:
obj - the other FormKey object.
Returns:
a true if both the objects have the same formName, componentId.

toString

public String toString()
Returns the debug information for the object

Returns:
The debug information

getCloseBrowserFormKey

public static FormKey getCloseBrowserFormKey()
Returns the FormKey that will render the JSP used for closing a browser window. The JSP to be rendered is found by the forward mapping 'jaffa_closeBrowser' specified in the struts-config.xml file.

Returns:
The FormKey that will render the JSP used for closing a browser window.


Copyright © 2002-2004 JAFFA Project.