ClassGenerator classGen) {
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = new InstructionList();
String methodName = Util.escape(template.getName().toString());
final NamedMethodGenerator methodGen =
new NamedMethodGenerator(ACC_PUBLIC,
org.apache.bcel.generic.Type.VOID,
new org.apache.bcel.generic.Type[] {
Util.getJCRefType(DOM_INTF_SIG),
Util.getJCRefType(NODE_ITERATOR_SIG),
Util.getJCRefType(TRANSLET_OUTPUT_SIG),
org.apache.bcel.generic.Type.INT
},
new String[] {
DOCUMENT_PNAME,
ITERATOR_PNAME,
TRANSLET_OUTPUT_PNAME,
NODE_PNAME
},
methodName,
getClassName(),
il, cpg);
il.append(template.compile(classGen, methodGen));
il.append(RETURN);
methodGen.stripAttributes(true);
methodGen.setMaxLocals();
methodGen.setMaxStack();
methodGen.removeNOPs();
classGen.addMethod(methodGen.getMethod());
}