Update of /cvsroot/struts/ajaxchat/WEB-INF/src/org/apache/struts/apps/ajaxchat/actionform
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21020/WEB-INF/src/org/apache/struts/apps/ajaxchat/actionform
Added Files:
LobbyActionForm.java package.html
Log Message:
--- NEW FILE: LobbyActionForm.java ---
/*
* Copyright 2005 Frank W. Zammetti
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts.apps.ajaxchat.actionform;
import java.lang.reflect.Field;
import java.util.Vector;
import org.apache.struts.action.ActionForm;
/**
* ActionForm for the lobby screen.
*
* @author <a href="mailto:fra...@pf...">Frank W. Zammetti</a>.
*/
public class LobbyActionForm extends ActionForm {
/**
* The name of the room user clicks on.
*/
private String name = "";
/**
* List of available rooms.
*/
private Vector rooms = new Vector();
/**
* Accessor for name field.
*
* @return String Current value of name Field.
*/
public String getName() {
return name;
} // End getName().
/**
* Mutator for name field.
*
* @param inName New value of name field.
*/
public void setName(String inName) {
name = inName;
} // End setName().
/**
* Accessor for rooms field.
*
* @return Vector List of room.
*/
public Vector getRooms() {
return rooms;
} // End getRooms().
/**
* Mutator for rooms field.
*
* @param inRooms New value of rooms field.
*/
public void setRooms(Vector inRooms) {
rooms = inRooms;
} // End setRooms().
/**
* Overriden toString method.
*
* @return A reflexively-built string representation of this bean.
*/
public String toString() {
String str = null;
StringBuffer sb = new StringBuffer(1000);
sb.append("[" + super.toString() + "]={");
boolean firstPropertyDisplayed = false;
try {
Field[] fields = this.getClass().getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
if (firstPropertyDisplayed) {
sb.append(", ");
} else {
firstPropertyDisplayed = true;
}
sb.append(fields[i].getName() + "=" + fields[i].get(this));
}
sb.append("}");
str = sb.toString().trim();
} catch (IllegalAccessException iae) {
iae.printStackTrace();
}
return str;
} // End toString().
} // End class.
--- NEW FILE: package.html ---
<body>
The org.apache.struts.apps.ajaxchat.actionform package contains the
Struts ActionForms (those that are not of type DynaActionForm and therefore
defined in the struts-config.xml file) that are used by the AjaxChat
application.
</body>
|