public void setComment(String comment) {
this.comment = comment;
}
public AttributesType writeXml() {
AttributesType attributes = new AttributesType();
if (comment != null) {
attributes.setComment(comment);
} else {
// by default, include the comment that the file is regenerated
// and that only one comment is allowable at any level
StringBuilder cmnt = new StringBuilder();
cmnt.append("\n");
cmnt.append("==================================================================\n");
cmnt.append("Warning - This XML file is regenerated by Geronimo whenever\n");
cmnt.append("changes are made to Geronimo's configuration.\n");
cmnt.append("\n");
cmnt.append("If you want to include comments, create a single comment element\n");
cmnt.append("element. They are allowable at any level of the configuration.\n");
cmnt.append("\n");
cmnt.append("!!!! Do not edit this file while Geronimo is running !!!!\n");
cmnt.append("==================================================================");
attributes.setComment(cmnt.toString());
}
for (ConfigurationOverride module: configurations.values()) {
ModuleType moduleType = module.writeXml();
attributes.getModule().add(moduleType);
}
return attributes;
}