org.objectweb.fractal.adl.merger
Interface NodeMerger

All Known Implementing Classes:
NodeMergerImpl

public interface NodeMerger

Interface to merge two ASTs.


Field Summary
static java.lang.String ITF_NAME
          The default name of this interface.
 
Method Summary
 java.lang.ClassLoader getClassLoader()
          Gets the class loader used by this node merger.
 Node merge(Node elem, Node superElem, java.util.Map<java.lang.String,java.lang.String> idAttributes)
          Merges the two given ASTs.
 void setClassLoader(java.lang.ClassLoader loader)
          Sets the class loader used by this node merger.
 

Field Detail

ITF_NAME

static final java.lang.String ITF_NAME
The default name of this interface.

See Also:
Constant Field Values
Method Detail

merge

Node merge(Node elem,
           Node superElem,
           java.util.Map<java.lang.String,java.lang.String> idAttributes)
           throws MergeException
Merges the two given ASTs. The first one is overridden by the second one. More precisely, the attributes of nodes of the first AST are replaced by attributes of the related nodes in the second AST. Nodes of the two AST are interrelated using the idAttributes map. This map associates a node type to the name of its attribute that identify a given node of this type among others. This is used when a node may contains many sub-nodes of the same type.
Note: the given ASTs may be acyclic graphs (i.e. a sub node may be shared by two or more nodes).

Parameters:
elem - an AST.
superElem - an AST that overrides the first one.
idAttributes - a map associating a node type to the name of its attribute that identify a given node of this type among others.
Returns:
the merged node.
Throws:
MergeException - when an error occurs. TODO detail error cases.

getClassLoader

java.lang.ClassLoader getClassLoader()
Gets the class loader used by this node merger.

Returns:
the class loader used by this node merger.

setClassLoader

void setClassLoader(java.lang.ClassLoader loader)
Sets the class loader used by this node merger.

Parameters:
loader - the class loader used by this node merger.


Copyright © 2001-2010 ObjectWeb Consortium. All Rights Reserved.