Examples of INVOKEVIRTUAL


Examples of org.apache.bcel.generic.INVOKEVIRTUAL

  // Translate the contents.
  il.append(classGen.loadTranslet());
  _select.translate(classGen, methodGen)
  il.append(methodGen.loadHandler());
  il.append(new INVOKEVIRTUAL(characters));

  // Restore character escaping setting to whatever it was.
  if (!_escaping) {
      il.append(methodGen.loadHandler());
      il.append(SWAP);
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

      il.append(classGen.loadTranslet());
      il.append(methodGen.loadDOM());
      il.append(methodGen.loadIterator());
      il.append(methodGen.loadHandler());
      il.append(methodGen.loadCurrentNode());
      il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
               methodName,
               "("
               + DOM_INTF_SIG
               + NODE_ITERATOR_SIG
               + TRANSLET_OUTPUT_SIG
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

      // Push parameter frame
      final int push = cpg.addMethodref(TRANSLET_CLASS,
                PUSH_PARAM_FRAME,
                PUSH_PARAM_FRAME_SIG);
      il.append(classGen.loadTranslet());
      il.append(new INVOKEVIRTUAL(push));
      // Translate with-params
      translateContents(classGen, methodGen);
  }

  final String className = stylesheet.getClassName();
  // Generate a valid Java method name
  String methodName = Util.escape(_name.toString());

  il.append(classGen.loadTranslet());
  il.append(methodGen.loadDOM());
  il.append(methodGen.loadIterator());
  il.append(methodGen.loadHandler());
  il.append(methodGen.loadCurrentNode());
  il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
                 methodName,
                 "("
                 + DOM_INTF_SIG
                 + NODE_ITERATOR_SIG
                 + TRANSLET_OUTPUT_SIG
                 + NODE_SIG
                 +")V")));
 

  if (stylesheet.hasLocalParams() || hasContents()) {
      // Pop parameter frame
      final int pop = cpg.addMethodref(TRANSLET_CLASS,
               POP_PARAM_FRAME,
               POP_PARAM_FRAME_SIG);
      il.append(classGen.loadTranslet());
      il.append(new INVOKEVIRTUAL(pop));
  }
    }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

 
  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;
    }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

      StringTokenizer tokens = new StringTokenizer(_cdata);
      while (tokens.hasMoreTokens()) {
    il.append(DUP);
    il.append(new PUSH(cpg, tokens.nextToken()));
    il.append(new INVOKEVIRTUAL(index));
      }
  }
  il.append(POP); // Cleanup - pop last translet reference off stack
    }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

  // Feck the this pointer on the stack...
  il.append(classGen.loadTranslet());
  // ...then the entity name...
  _entity.translate(classGen, methodGen);
  // ...to get the value from the hashtable in AbstractTranslet.
  il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
                 "getUnparsedEntity",
                 "(Ljava/lang/String;)"+
                 "Ljava/lang/String;")));
    }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

  // Call getKeyIndex in AbstractTranslet with the name of the key
  // to get the index for this key (which is also a node iterator).
  il.append(classGen.loadTranslet());
  il.append(new PUSH(cpg,_index));
  il.append(new INVOKEVIRTUAL(getKeyIndex));
 
  // Now use the value in the second argument to determine what nodes
  // the iterator should return.
  il.append(SWAP);
  il.append(new PUSH(cpg,_value));
  if (this instanceof IdPattern)
  {
      il.append(new INVOKEVIRTUAL(lookupId));
  }
  else
  {
      il.append(new INVOKEVIRTUAL(lookupKey));
  }

  _trueList.add(il.append(new IFNE(null)));
  _falseList.add(il.append(new GOTO(null)));
    }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

        final int charDataCount = getXSLTC().getCharacterDataCount();
        final int toCharArray = cpg.addMethodref(STRING, "toCharArray", "()[C");
        for (int i = 0; i < charDataCount; i++) {
            staticConst.markChunkStart();
            il.append(new PUSH(cpg, getXSLTC().getCharacterData(i)));
            il.append(new INVOKEVIRTUAL(toCharArray));
            il.append(new PUTSTATIC(cpg.addFieldref(_className,
                                               STATIC_CHAR_DATA_FIELD+i,
                                               STATIC_CHAR_DATA_FIELD_SIG)));
            staticConst.markChunkEnd();
        }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

      il.append(DUP);
  }
 
  il.append(classGen.loadTranslet());
  il.append(transf.loadDOM());
  il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
                 "makeDOMAdapter",
                 "("+DOM_INTF_SIG+")"+
                 DOM_ADAPTER_SIG)));
  // DOMAdapter is on the stack

  if (isMultiDocument()) {
      final int init = cpg.addMethodref(MULTI_DOM_CLASS,
                "<init>",
                "("+DOM_INTF_SIG+")V");
      il.append(new INVOKESPECIAL(init));
      // MultiDOM is on the stack
  }
 
  //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());
  current.setStart(il.append(new ISTORE(current.getIndex())));

  // Transfer the output settings to the output post-processor
  il.append(classGen.loadTranslet());
  il.append(transf.loadHandler());
  final int index = cpg.addMethodref(TRANSLET_CLASS,
             "transferOutputSettings",
             "("+OUTPUT_HANDLER_SIG+")V");
  il.append(new INVOKEVIRTUAL(index));

        /*
         * Compile buildKeys() method. Note that this method is not
         * invoked here as keys for the input document are now created
         * in topLevel(). However, this method is still needed by the
         * LoadDocument class.
         */       
        final String keySig = compileBuildKeys(classGen);
        final int keyIdx = cpg.addMethodref(getClassName(),
                                               "buildKeys", keySig);
               
        // Look for top-level elements that need handling
  final Enumeration toplevel = elements();
  if (_globals.size() > 0 || toplevel.hasMoreElements()) {
      // Compile method for handling top-level elements
      final String topLevelSig = compileTopLevel(classGen);
      // Get a reference to that method
      final int topLevelIdx = cpg.addMethodref(getClassName(),
                 "topLevel",
                 topLevelSig);
      // Push all parameters on the stack and call topLevel()
      il.append(classGen.loadTranslet()); // The 'this' pointer
      il.append(classGen.loadTranslet());
      il.append(new GETFIELD(domField))// The DOM reference
      il.append(transf.loadIterator());
      il.append(transf.loadHandler());    // The output handler
      il.append(new INVOKEVIRTUAL(topLevelIdx));
 

  // start document
  il.append(transf.loadHandler());
  il.append(transf.startDocument());

  // push first arg for applyTemplates
  il.append(classGen.loadTranslet());
  // push translet for GETFIELD to get DOM arg
  il.append(classGen.loadTranslet());
  il.append(new GETFIELD(domField));
  // push remaining 2 args
  il.append(transf.loadIterator());
  il.append(transf.loadHandler());
  il.append(new INVOKEVIRTUAL(applyTemplates));
  // endDocument
  il.append(transf.loadHandler());
  il.append(transf.endDocument());

  il.append(RETURN);
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

  il.append(methodGen.loadDOM());
  il.append(methodGen.loadCurrentNode());
  il.append(new INVOKEINTERFACE(getNodeValue, 2));   

  // Finally do the call to add an entry in the index for this key.
  il.append(new INVOKEVIRTUAL(buildKeyIndex));
 
  il.append(classGen.loadTranslet());
  il.append(new PUSH(cpg, getName()));
  il.append(methodGen.loadDOM());
  il.append(new INVOKEVIRTUAL(keyDom));

  nextNode.setTarget(il.append(methodGen.loadIterator()));
  il.append(methodGen.nextNode())

  il.append(DUP);
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.