*/
public void visit(MappingBaseNode baseNode) {
String source = baseNode.getSource();
if(source != null) {
// create the source node
MappingSourceNode sourceNode = new MappingSourceNode(source);
if (baseNode instanceof MappingRecursiveElement) {
sourceNode.setAliasResultName(((MappingRecursiveElement)baseNode).getMappingClass());
}
// Get the parent of current node
MappingBaseNode parent = baseNode.getParentNode();
// remove the current node from its parent
parent.removeChildNode(baseNode);
// make source is child of current nodes parent
parent.addSourceNode(sourceNode);
// now make the current node, child of the source.
sourceNode.addChild(baseNode);
sourceNode.setExclude(baseNode.isExcluded());
sourceNode.setMinOccurrs(baseNode.getMinOccurence());
sourceNode.setMaxOccurrs(baseNode.getMaxOccurence());
sourceNode.setStagingTables(baseNode.getStagingTables());
baseNode.setSource(null);
baseNode.setStagingTables(null);
}
}