* @return the component type description of
* the current component type
*/
private Element generateComponentMetadata() {
Element element = new Element("component", "");
element.addAttribute(new Attribute("classname", m_classname));
if (m_name != null) {
element.addAttribute(new Attribute("name", m_name));
}
if (m_version != null) {
element.addAttribute(new Attribute("version", m_version));
}
if (m_factoryMethod != null) {
element.addAttribute(new Attribute("factory-method", m_factoryMethod));
}
if (! m_public) {
element.addAttribute(new Attribute("public", "false"));
}
if (m_immediate) {
element.addAttribute(new Attribute("immediate", "true"));
}
for (Service svc : m_services) {
element.addElement(svc.getElement());
}
for (Dependency dep : m_dependencies) {
element.addElement(dep.getElement());
}
for (TemporalDependency dep : m_temporals) {
element.addElement(dep.getElement());
}
if (m_validate != null) {
Element callback = new Element("callback", "");
callback.addAttribute(new Attribute("transition", "validate"));
callback.addAttribute(new Attribute("method", m_validate));
element.addElement(callback);
}
if (m_invalidate != null) {
Element callback = new Element("callback", "");
callback.addAttribute(new Attribute("transition", "invalidate"));
callback.addAttribute(new Attribute("method", m_invalidate));
element.addElement(callback);
}
// Properties
// First determine if we need the properties element
if (m_propagation || m_msPID != null || ! m_properties.isEmpty()) {
Element properties = new Element("properties", "");
if (m_propagation) {
properties.addAttribute(new Attribute("propagation", "true"));
}
if (m_msPID != null) {
properties.addAttribute(new Attribute("pid", m_msPID));
}
if (m_updated != null) {
properties.addAttribute(new Attribute("updated", m_updated));
}
for (Property prop : m_properties) {
properties.addElement(prop.getElement());
}
element.addElement(properties);