this.maker = maker;
}
public RegistryObject unmarshal(Element element)
{
Contact obj = new Contact();
Vector nodeList = null;
AbstractHandler handler = null;
// Attributes
String useType = element.getAttribute("useType");
if ((useType != null) && (useType.trim().length() > 0))
obj.setUseType(useType);
// Text Node Value
// {none}
// Child Elements
nodeList = XMLUtils.getChildElementsByTagName(element,PersonNameHandler.TAG_NAME);
if (nodeList.size() > 0)
{
handler = maker.lookup(PersonNameHandler.TAG_NAME);
obj.setPersonName((PersonName)handler.unmarshal((Element)nodeList.elementAt(0)));
}
nodeList = XMLUtils.getChildElementsByTagName(element,DescriptionHandler.TAG_NAME);
for (int i=0; i<nodeList.size(); i++)
{
handler = maker.lookup(DescriptionHandler.TAG_NAME);
Description descr = (Description)handler.unmarshal((Element)nodeList.elementAt(i));
if (descr != null)
obj.addDescription(descr);
}
nodeList = XMLUtils.getChildElementsByTagName(element,AddressHandler.TAG_NAME);
for (int i=0; i<nodeList.size(); i++)
{
handler = maker.lookup(AddressHandler.TAG_NAME);
obj.addAddress((Address)handler.unmarshal((Element)nodeList.elementAt(i)));
}
nodeList = XMLUtils.getChildElementsByTagName(element,EmailHandler.TAG_NAME);
for (int i=0; i<nodeList.size(); i++)
{
handler = maker.lookup(EmailHandler.TAG_NAME);
obj.addEmail((Email)handler.unmarshal((Element)nodeList.elementAt(i)));
}
nodeList = XMLUtils.getChildElementsByTagName(element,PhoneHandler.TAG_NAME);
for (int i=0; i<nodeList.size(); i++)
{
handler = maker.lookup(PhoneHandler.TAG_NAME);
obj.addPhone((Phone)handler.unmarshal((Element)nodeList.elementAt(i)));
}
return obj;
}