delegate.getNodeName() + "!");
}
this.delegate = (Element)delegate;
NamedNodeMap attrs = delegate.getAttributes();
Node mbeanNameAttr = attrs.getNamedItem("name");
on = new ObjectName(mbeanNameAttr.getNodeValue());
log.trace("ObjectName is: " + on);
Node mbeanCodeAttr = attrs.getNamedItem("code");
className = mbeanCodeAttr.getNodeValue();
Node mbeanXMBeanDD = attrs.getNamedItem("xmbean-dd");
if (mbeanXMBeanDD != null)
{
xmbeandd = mbeanXMBeanDD.getNodeValue();
}
mbeanConfigAttributes = new HashMap();
mbeanOptionalAttributeNames = new HashMap();
constructors = new ArrayList();
if (delegate.hasChildNodes())
{
NodeList l = delegate.getChildNodes();
for(int i = 0; i < l.getLength(); i ++)
{
Node mbeanConfigNode = l.item(i);
String mbeanConfigNodeName = mbeanConfigNode.getNodeName();
if ("attribute".equals(mbeanConfigNodeName))
{
attrs = mbeanConfigNode.getAttributes();
String configAttribName = attrs.getNamedItem("name").getNodeValue();
String configAttribValue = null;
Node n = attrs.getNamedItem("value");
if (n != null)
{
configAttribValue = n.getNodeValue();
}
else
{
configAttribValue = XMLUtil.getTextContent(mbeanConfigNode);
}
configAttribValue = XMLUtil.stripCDATA(configAttribValue);
mbeanConfigAttributes.put(configAttribName, configAttribValue);
}
else if ("depends".equals(mbeanConfigNodeName))
{
attrs = mbeanConfigNode.getAttributes();
Node optionalAttributeNode = attrs.getNamedItem("optional-attribute-name");
if (optionalAttributeNode != null)
{
String optionalAttributeName = optionalAttributeNode.getNodeValue();
String optionalAttributeValue = XMLUtil.getTextContent(mbeanConfigNode);
mbeanOptionalAttributeNames.put(optionalAttributeName, optionalAttributeValue);
}
}
else if ("constructor".equals(mbeanConfigNodeName))
{
ConstructorElement c = new ConstructorElement(mbeanConfigNode);
constructors.add(c);
if (mbeanConfigNode.hasChildNodes())
{
NodeList nl = mbeanConfigNode.getChildNodes();
for(int j = 0; j < nl.getLength(); j++)
{
Node n = nl.item(j);
String name = n.getNodeName();
if ("arg".equals(name))
{
NamedNodeMap at = n.getAttributes();
Node attributeNode = at.getNamedItem("type");
Class type = stringToClass(attributeNode.getNodeValue());
attributeNode = at.getNamedItem("value");
String value = attributeNode.getNodeValue();
c.addArgument(type, value, attributeNode);
}
}
}