Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.ConstantPoolGen.addInterfaceMethodref()


 
  //store to _dom variable
  il.append(new PUTFIELD(domField));

  // continue with globals initialization
  final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
              "getIterator",
              "()"+NODE_ITERATOR_SIG);
  il.append(transf.loadDOM());
  il.append(new INVOKEINTERFACE(gitr, 1));
        il.append(transf.nextNode());
View Full Code Here


   * run the risk of returning the same node several times. We put
   * a new iterator on top of the existing one to assure node order
   * and prevent returning a single node multiple times.
   */
  if (_orderNodes) {
      final int order = cpg.addInterfaceMethodref(DOM_INTF,
              ORDER_ITERATOR,
              ORDER_ITERATOR_SIG);
      il.append(methodGen.loadDOM());
      il.append(SWAP);
      il.append(methodGen.loadContextNode());
View Full Code Here

  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();

  if (!_ignore) {
      // Turn off character escaping if so is wanted.
      final int esc = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
                  "setEscaping", "(Z)Z");
      if (!_escaping) {
    il.append(methodGen.loadHandler());
    il.append(new PUSH(cpg, false));
    il.append(new INVOKEINTERFACE(esc, 2));
View Full Code Here

            il.append(methodGen.loadHandler());

            // Call characters(String) or characters(char[],int,int), as
            // appropriate.
            if (!canLoadAsArrayOffsetLength()) {
                final int characters = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
                                                           "characters",
                                                           "("+STRING_SIG+")V");
                il.append(new PUSH(cpg, _text));
                il.append(new INVOKEINTERFACE(characters, 2));
            } else {
View Full Code Here

                                                           "characters",
                                                           "("+STRING_SIG+")V");
                il.append(new PUSH(cpg, _text));
                il.append(new INVOKEINTERFACE(characters, 2));
            } else {
                final int characters = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
                                                                 "characters",
                                                                 "([CII)V");
                loadAsArrayOffsetLength(classGen, methodGen);
          il.append(new INVOKEINTERFACE(characters, 4));
            }
View Full Code Here

        MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();

  // Returns the string value for a node in the DOM
  final int getNamespace = cpg.addInterfaceMethodref(DOM_INTF,
                 "getNamespaceName",
                 "(I)"+STRING_SIG);
  super.translate(classGen, methodGen);
  il.append(new INVOKEINTERFACE(getNamespace, 2));
    }
View Full Code Here

     */
    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();

  final int getName = cpg.addInterfaceMethodref(DOM_INTF,
                  GET_NODE_NAME,
                  GET_NODE_NAME_SIG);
  super.translate(classGen, methodGen);
  il.append(new INVOKEINTERFACE(getName, 2));
    }
View Full Code Here

  else if (methodGen instanceof TestGenerator) {
      il.append(new ILOAD(POSITION_INDEX));
  }
  else {
      final ConstantPoolGen cpg = classGen.getConstantPool();
            final int index = cpg.addInterfaceMethodref(NODE_ITERATOR,
                                                       "getPosition",
                                                       "()I");

      il.append(methodGen.loadIterator());
            il.append(new INVOKEINTERFACE(index,1));
View Full Code Here

  // Get the name of the node to copy and save for later
  il.append(methodGen.loadDOM());
  il.append(methodGen.loadCurrentNode());
  il.append(methodGen.loadHandler());
  final int cpy = cpg.addInterfaceMethodref(DOM_INTF,
              "shallowCopy",
              "("
              + NODE_SIG
              + TRANSLET_OUTPUT_SIG
              + ")" + STRING_SIG);
View Full Code Here

  // Create new instance of DOM class (with RTF_INITIAL_SIZE nodes)
  //int index = cpg.addMethodref(DOM_IMPL, "<init>", "(I)V");
  //il.append(new NEW(cpg.addClass(DOM_IMPL)));
 
  il.append(methodGen.loadDOM());
  int index = cpg.addInterfaceMethodref(DOM_INTF,
         "getResultTreeFrag",
         "(IIZ)" + DOM_INTF_SIG);
  il.append(new PUSH(cpg, RTF_INITIAL_SIZE));
  il.append(new PUSH(cpg, rtfType));
  il.append(new PUSH(cpg, stylesheet.callsNodeset()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.