HashMap definedParams = new HashMap();
int n = socketList.size();
for (int i = 0; i < n; ++i)
{
ActivitySocket socket = (ActivitySocket) socketList.get(i);
StringBuffer cm = socket.isEntrySocket() ? inputComment : outputComment;
String socketName = socket.getName();
String socketIdent = StandardSocketNames.getStandardSocketNameIdentifier(socketName);
if (socketIdent == null)
{
// Add a string constant definition for this socket name to the 'constants' placeholder
socketIdent = makeSocketName(socketName);
String type = socket.isEntrySocket() ? "Input" : "Output";
w.addToPlaceholder("socketConstants", "/** " + type + " socket " + socketName + " */");
w.addToPlaceholder("socketConstants", "private static final String " + socketIdent + " = \"" + socketName + "\";");
w.addToPlaceholder("socketConstants", "");
}
if (!socket.isEntrySocket() && socket.isDefaultSocket())
{
standardExitSocket = socketIdent;
}
cm.append(" Socket '");
cm.append(socketName);
cm.append("'");
String dn = socket.getDisplayName();
if (dn != null)
{
cm.append(": ");
cm.append(dn);
}
cm.append("\n");
List paramList = socket.getParamList();
if (paramList != null)
{
int np = paramList.size();
for (int ip = 0; ip < np; ++ip)
{
ActivityParam param = (ActivityParam) paramList.get(ip);
String paramName = param.getName();
String paramIdent = makeParamName(paramName);
if (!definedParams.containsKey(paramName))
{
definedParams.put(paramName, Boolean.TRUE);
w.addToPlaceholder("paramConstants", "/** Parameter " + paramName + " */");
w.addToPlaceholder("paramConstants", "private static final String " + paramIdent + " = \"" + paramName + "\";");
w.addToPlaceholder("paramConstants", "");
}
cm.append(" Parameter '");
cm.append(paramName);
cm.append("'");
dn = param.getDisplayName();
if (dn != null)
{
cm.append(": ");
cm.append(dn);
}
cm.append("\n");
DataTypeItem type = param.getDataType();
if (type != null)
{
String className = type.getClassName();
if (className == null)
className = "Object";
String typeName = extractUnqualifiedName(w, className);
String paramVariableName = NameUtil.makeMemberName(paramName);
if (socket.isEntrySocket())
{
if (w.isPlaceholderEmpty("inputParamAccess"))
{
w.addToPlaceholder("inputParamAccess", "/* Input parameter access code");
}