pw.println (" private void initFieldAttributes () {");
pw.println (" java.util.Set attrs = null;");
JavaField[] fields = javaClass.getFields ();
for (int i = 0; i < fields.length; i++) {
JavaField member = (JavaField) fields[i];
if (member.getTags ().length > 0) {
String key = member.getName ();
pw.println (" attrs = new java.util.HashSet ();");
addExpressions (member.getTags (), pw, "attrs", sourceFile);
pw.println (" fieldAttributes.put (\"" + key + "\", attrs);");
pw.println (" attrs = null;");
pw.println ();
}
}
pw.println (" }");
// ---- Method Attributes
pw.println (" private void initMethodAttributes () {");
pw.println (" java.util.Set attrs = null;");
pw.println (" java.util.List bundle = null;");
JavaMethod[] methods = javaClass.getMethods ();
for (int i = 0; i < methods.length; i++) {
JavaMethod member = (JavaMethod) methods[i];
if (!member.isConstructor () && member.getTags ().length > 0) {
StringBuffer sb = new StringBuffer ();
sb.append (member.getName ()).append ("(");
sb.append (getParameterTypes (member.getParameters ()));
sb.append (")");
String key = sb.toString ();
pw.println (" bundle = new java.util.ArrayList ();");
pw.println (" attrs = new java.util.HashSet ();");
addExpressions (member.getTags (), null, pw, "attrs", sourceFile);
pw.println (" bundle.add (attrs);");
pw.println (" attrs = null;");
pw.println (" attrs = new java.util.HashSet ();");
addExpressions (member.getTags (), "return", pw, "attrs", sourceFile);
pw.println (" bundle.add (attrs);");
pw.println (" attrs = null;");
JavaParameter[] parameters = member.getParameters ();
for (int j = 0; j < parameters.length; j++) {
JavaParameter parameter = (JavaParameter) parameters[j];
pw.println (" attrs = new java.util.HashSet ();");
addExpressions (member.getTags (), parameter.getName (), pw, "attrs", sourceFile);
pw.println (" bundle.add (attrs);");
pw.println (" attrs = null;");
}
pw.println (" methodAttributes.put (\"" + key + "\", bundle);");
pw.println (" bundle = null;");
pw.println ();
}
}
pw.println (" }");
// ---- Constructor Attributes
pw.println (" private void initConstructorAttributes () {");
pw.println (" java.util.Set attrs = null;");
pw.println (" java.util.List bundle = null;");
JavaMethod[] constructors = javaClass.getMethods ();
for (int i = 0; i < constructors.length; i++) {
JavaMethod member = (JavaMethod) constructors[i];
if (member.isConstructor () && member.getTags ().length > 0) {
StringBuffer sb = new StringBuffer ();
sb.append ("(");
sb.append (getParameterTypes (member.getParameters ()));
sb.append (")");
String key = sb.toString ();
pw.println (" bundle = new java.util.ArrayList ();");
pw.println (" attrs = new java.util.HashSet ();");
addExpressions (member.getTags (), null, pw, "attrs", sourceFile);
pw.println (" bundle.add (attrs);");
pw.println (" attrs = null;");
JavaParameter[] parameters = member.getParameters ();
for (int j = 0; j < parameters.length; j++) {
JavaParameter parameter = (JavaParameter) parameters[j];
pw.println (" attrs = new java.util.HashSet ();");
addExpressions (member.getTags (), parameter.getName (), pw, "attrs", sourceFile);
pw.println (" bundle.add (attrs);");
pw.println (" attrs = null;");
}
pw.println (" constructorAttributes.put (\"" + key + "\", bundle);");