String tagName = "";
try
{
Document configForQBXML;
NamedNodeMap attr;
Class classCV[] = new Class[1];
Class argumentType[] = new Class[1];
Object arguments[] = new Object[1];
String className = getValueOfNodeByTagName(configXML, TAG_VONAME);
String typeArg = "";
String value = "";
NodeList listItem = configXML.getChildNodes();
NodeList tmpNodeList = null;
int length = listItem.getLength();
classCV[0] = Class.forName(className);
objectCV = classCV[0].newInstance();
Method method = null;
setType(objectCV, configXML, className);
for (int i = 0; i < length; i++)
{
tagName = listItem.item(i).getNodeName();
if (tagName.equals("#text") || !listItem.item(i).hasAttributes())
{
continue;
}
attr = listItem.item(i).getAttributes();
if (attr.getNamedItem("aatocv") != null)
{
tmpNodeList = getDocumentFromString(xml.toString()).getElementsByTagName(tagName);
if (tmpNodeList.getLength() != 0)
{
setAAtoCV(objectCV, attr, tmpNodeList, classCV, tagName);
}
continue;
}
if (attr.getNamedItem("xml") != null)
{
configForQBXML = getDocumentFromString(getDocumentFromString(attr.getNamedItem("xml").getNodeValue()).getElementsByTagName(attr.getNamedItem("tag").getNodeValue()).item(0).toString());
tmpNodeList = getDocumentFromString(xml.toString()).getElementsByTagName(tagName);
if (tmpNodeList.item(0) != null)
{
forward(objectCV, attr, tmpNodeList.item(0), classCV, className, configForQBXML);
}
continue;
}
value = getValueOfNodeByTagName(xml, tagName);
if (value == null)
continue;
typeArg = attr.getNamedItem("type").getNodeValue();
argumentType[0] = getArgType(typeArg);
arguments[0] = getObjectByName(typeArg, value);
method = classCV[0].getMethod(attr.getNamedItem("set").getNodeValue(), argumentType);
method.invoke(objectCV, arguments);
}
} catch (Exception e)
{
logger.error("QBXMLTag = <" + tagName + "> ********* Error while loading up/down classes : ", e);