*/
protected void loadFormat(Element formatElement, final String sName)
{
XMLMetadataHelper.verifyRootElement(formatElement, "Format");
final Format format = new Format(sName);
format.setMetadata(m_metadata);
format.setLoader(m_helper.getClassObject(XMLUtil.getReqStringAttr(formatElement, "loader")));
String sExporter = XMLUtil.getStringAttr(formatElement, "exporter");
if (sExporter != null)
{
format.setExporter(m_helper.getClassObject(sExporter));
}
XMLUtil.withFirstChildElement(formatElement, "Parser", true, new ElementHandler()
{
public void handleElement(Element componentElement)
{
Component parser = new Component("<MessageParser:" + sName + ">");
loadComponent(componentElement, parser);
format.setParser(parser);
}
});
XMLUtil.withFirstChildElement(formatElement, "Formatter", true, new ElementHandler()
{
public void handleElement(Element componentElement)
{
Component formatter = new Component("<MessageFormatter:" + sName + ">");
loadComponent(componentElement, formatter);
format.setFormatter(formatter);
}
});
m_metadata.addFormat(format);
}