}
@Override
protected XmlElement addConfigurationElement(XmlElement nodeElement) {
XmlElement configElement = nodeElement.addElement(GraphSchema.NS,
GraphSchema.NODE_CONFIG_TAG);
if (this.configured) {
// Don't save the name here if this node has not been configured.
XmlElement nameElement = configElement.addElement(GraphSchema.NS,
NAME_TAG);
nameElement.addChild(this.configuredName);
}
if (this.description != null) {
XmlElement descriptionElement = configElement.addElement(
GraphSchema.NS, DESCRIPTION_TAG);
descriptionElement.addChild(this.description);
}
if (this.parameterType != null) {
XmlElement qnameElement = configElement.addElement(GraphSchema.NS,
DATA_TYPE_QNAME_TAG);
qnameElement.addChild(this.parameterType.toString());
}
if (this.metadata != null) {
XmlElement metadataElement = configElement.addElement(
GraphSchema.NS, METADATA_TAG);
// Clone the metadata to avoid parent problem because this can be
// called multiple times.
metadataElement.addChild(XMLUtil.deepClone(this.metadata));
}
return configElement;
}