/** * This method is called when the name of the element is known at compile time. * In this case, there is no need to inspect the element name at runtime to * determine if a prefix exists, needs to be generated, etc. */ public void translateLiteral(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); if (!_ignore) { il.append(methodGen.loadHandler()); _name.translate(classGen, methodGen); il.append(DUP2); il.append(methodGen.startElement()); if (_namespace != null) { il.append(methodGen.loadHandler()); il.append(new PUSH(cpg, _prefix)); _namespace.translate(classGen,methodGen); il.append(methodGen.namespace()); } } translateContents(classGen, methodGen); if (!_ignore) { il.append(methodGen.endElement()); } }
il.append(methodGen.loadHandler()); il.append(new PUSH(cpg,false)); il.append(new INVOKEINTERFACE(setEscaping,2)); il.append(methodGen.loadHandler()); il.append(new INVOKEVIRTUAL(characters)); } else { il.append(methodGen.loadHandler()); il.append(new INVOKEINTERFACE(characters, 3)); il.append(methodGen.loadHandler()); il.append(SWAP); il.append(new INVOKEINTERFACE(setEscaping,2));
il.append(methodGen.loadHandler()); declaresDefaultNS = true; il.append(methodGen.loadHandler()); il.append(new PUSH(cpg,prefix)); il.append(new PUSH(cpg,uri)); && ((XslElement) _parent).declaresDefaultNS()) il.append(methodGen.loadHandler()); il.append(new PUSH(cpg, Constants.EMPTYSTRING)); il.append(new PUSH(cpg, Constants.EMPTYSTRING));
"setEscaping", "(Z)Z"); if (!_escaping) { il.append(methodGen.loadHandler()); il.append(new PUSH(cpg, false)); il.append(new INVOKEINTERFACE(esc, 2)); il.append(methodGen.loadHandler()); il.append(methodGen.loadHandler()); il.append(SWAP); il.append(new INVOKEINTERFACE(esc, 2));
/** * Compiles the default action for DOM text nodes and attribute nodes: * output the node's text value */ private InstructionList compileDefaultText(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = new InstructionList(); final int chars = cpg.addInterfaceMethodref(DOM_INTF, CHARACTERS, CHARACTERS_SIG); il.append(methodGen.loadDOM()); il.append(new ILOAD(_currentIndex)); il.append(methodGen.loadHandler()); il.append(new INVOKEINTERFACE(chars, 3)); il.append(new GOTO_W(next)); return il; }
il.append(methodGen.loadDOM()); il.append(methodGen.loadIterator()); il.append(methodGen.loadHandler()); il.append(methodGen.loadCurrentNode()); il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
il.append(methodGen.loadHandler()); il.append(new INVOKEINTERFACE(cpy1, 3)); il.append(methodGen.loadDOM()); _select.translate(classGen, methodGen); il.append(methodGen.loadHandler()); il.append(new INVOKEINTERFACE(cpy2, 3)); il.append(methodGen.loadHandler()); il.append(new INVOKEINTERFACE(cpy2, 3)); il.append(methodGen.loadHandler()); il.append(methodGen.loadCurrentNode()); il.append(methodGen.loadDOM()); il.append(classGen.loadTranslet()); _select.translate(classGen, methodGen); il.append(methodGen.loadHandler()); il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS, CHARACTERSW,
il.append(methodGen.loadDOM()); il.append(methodGen.loadIterator()); il.append(methodGen.loadHandler()); final int method = cpg.addMethodref(classGen.getClassName(), methodName, ATTR_SET_SIG);
il.append(methodGen.loadDOM()); il.append(methodGen.loadIterator()); il.append(methodGen.loadHandler()); final int method = cpg.addMethodref(classGen.getClassName(), methodName, ATTR_SET_SIG);
il.append(methodGen.loadHandler()); final String applyTemplatesSig = classGen.getApplyTemplatesSig(); final int applyTemplates = cpg.addMethodref(className,
il.append(methodGen.loadHandler()); il.append(methodGen.loadHandler()); il.append(new INVOKEVIRTUAL(close));
il.append(methodGen.loadDOM()); il.append(methodGen.loadIterator()); il.append(methodGen.loadHandler()); il.append(methodGen.loadCurrentNode());
il.append(methodGen.loadHandler());
il.append(methodGen.loadHandler()); il.append(methodGen.loadHandler());
/** * Compiles the default handling for DOM elements: traverse all children */ private InstructionList compileDefaultRecursion(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = new InstructionList(); final String applyTemplatesSig = classGen.getApplyTemplatesSig(); final int git = cpg.addInterfaceMethodref(DOM_INTF, GET_CHILDREN, GET_CHILDREN_SIG); final int applyTemplates = cpg.addMethodref(getClassName(), functionName(), applyTemplatesSig); il.append(classGen.loadTranslet()); il.append(methodGen.loadDOM()); il.append(methodGen.loadDOM()); il.append(new ILOAD(_currentIndex)); il.append(new INVOKEINTERFACE(git, 2)); il.append(methodGen.loadHandler()); il.append(new INVOKEVIRTUAL(applyTemplates)); il.append(new GOTO_W(next)); return il; }
il.append(methodGen.loadHandler()); } else { il.append(methodGen.loadHandler());
il.append(methodGen.loadHandler()); il.append(methodGen.loadHandler()); il.append(methodGen.loadDOM()); il.append(methodGen.loadCurrentNode());
il.append(methodGen.loadHandler()); il.append(new PUSH(cpg,_prefix)); _namespace.translate(classGen,methodGen); il.append(methodGen.loadHandler()); } else { il.append(methodGen.loadHandler());
il.append(methodGen.loadHandler()); final int cpy = cpg.addInterfaceMethodref(DOM_INTF, "shallowCopy", il.append(methodGen.loadHandler()); name.setEnd(il.append(new ALOAD(name.getIndex()))); il.append(methodGen.endElement());
il.append(methodGen.loadDOM()); il.append(methodGen.loadIterator()); il.append(methodGen.loadHandler()); il.append(methodGen.loadCurrentNode());