new Object[] {sDerivation, transformation.getName()});
}
transformation.setPrimary(XMLUtil.getBooleanAttr(transformationElement, "primary", true));
XMLUtil.withFirstChildElement(transformationElement, "Initializer", false, new ElementHandler()
{
public void handleElement(Element initializerElement)
{
transformation.setInitializer((Pair)m_helper.parse(m_helper.getElementValue(initializerElement),
true, sURLPrefix + ".initializer", transformation.getPosMap(), null, m_metadata.getGlobalEnvironment()));
}
});
XMLUtil.withFirstChildElement(transformationElement, "Mappings", false, new ElementHandler()
{
public void handleElement(Element mappingsElement)
{
XMLUtil.forEachChildElement(mappingsElement, "Mapping",
m_helper.new ElementHandler("mapping")
{
private int m_nOrdinal;
public void handleElement(Element mappingElement, String sMappingName)
{
TransformationMapping mapping = new TransformationMapping(sMappingName);
if (sMappingName == null)
{
sMappingName = String.valueOf(m_nOrdinal);
}
loadTransformationMapping(mappingElement, sURLPrefix + ".mapping." + sMappingName, mapping, transformation);
transformation.addMapping(mapping);
m_nOrdinal += 1;
}
protected String getName(Element element)
{
return XMLUtil.getStringAttr(element, "name");
}
});
}
});
XMLUtil.withFirstChildElement(transformationElement, "Finalizer", false,new ElementHandler()
{
public void handleElement(Element finalizerElement)
{
transformation.setFinalizer((Pair)m_helper.parse(m_helper.getElementValue(finalizerElement),
true, sURLPrefix + ".finalizer", transformation.getPosMap(), null, m_metadata.getGlobalEnvironment()));