replaceMixinNode(node, mixinDef);
}
private static void replaceMixinNode(MixinNode mixinNode,
MixinDefNode mixinDef) {
MixinDefNode defClone = (MixinDefNode) DeepCopy.copy(mixinDef);
defClone.traverse();
defClone.replaceContentDirective(mixinNode);
if (mixinDef.getArglist().isEmpty()) {
mixinNode.getParentNode().appendChildrenAfter(
new ArrayList<Node>(defClone.getChildren()), mixinNode);
} else {
if (mixinNode.getArglist() != null
&& !mixinNode.getArglist().isEmpty()) {
replacePossibleArguments(mixinNode, defClone);
}
Node previous = mixinNode;
for (final Node child : new ArrayList<Node>(defClone.getChildren())) {
replaceChildVariables(defClone, child);
mixinNode.getParentNode().appendChild(child, previous);
previous = child;
}