// Store new DOM into a local variable
newDom = methodGen.addLocalVariable("rt_to_reference_dom",
Util.getJCRefType(DOM_INTF_SIG),
null, null);
il.append(new CHECKCAST(cpg.addClass(DOM_INTF_SIG)));
il.append(new ASTORE(newDom.getIndex()));
// Overwrite old handler with DOM handler
index = cpg.addInterfaceMethodref(DOM_INTF,
"getOutputDomBuilder",
"()" + TRANSLET_OUTPUT_SIG);
il.append(new INVOKEINTERFACE(index,1));
//index = cpg.addMethodref(DOM_IMPL,
// "getOutputDomBuilder",
// "()" + TRANSLET_OUTPUT_SIG);
//il.append(new INVOKEVIRTUAL(index));
il.append(DUP);
il.append(DUP);
// Store DOM handler in a local in order to call endDocument()
domBuilder =
methodGen.addLocalVariable("rt_to_reference_handler",
Util.getJCRefType(TRANSLET_OUTPUT_SIG),
null, null);
il.append(new ASTORE(domBuilder.getIndex()));
// Call startDocument on the new handler
index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
"startDocument", "()V");
il.append(new INVOKEINTERFACE(index, 1));