Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.NEW


              "<init>",
              "("
              +NODE_ITERATOR_SIG
              +NODE_ITERATOR_SIG
              +")V");
  il.append(new NEW(cpg.addClass(STEP_ITERATOR_CLASS)));
  il.append(DUP);

  // Compile path iterator
  _path.translate(classGen, methodGen); // iterator on stack....
  _step.translate(classGen, methodGen);
View Full Code Here


  il.append(methodGen.loadIterator());

  // Create a new matching iterator using the matching node
  index = cpg.addMethodref(MATCHING_ITERATOR, "<init>",
         "(I" + NODE_ITERATOR_SIG + ")V");
  il.append(new NEW(cpg.addClass(MATCHING_ITERATOR)));
  il.append(DUP);
  il.append(new ILOAD(match.getIndex()));
  _step.translate(classGen, methodGen);
  il.append(new INVOKESPECIAL(index));
View Full Code Here

  // push translet for PUTFIELD
  il.append(classGen.loadTranslet());
  // prepare appropriate DOM implementation
 
  if (isMultiDocument()) {
      il.append(new NEW(cpg.addClass(MULTI_DOM_CLASS)));
      il.append(DUP);
  }
 
  il.append(classGen.loadTranslet());
  il.append(transf.loadDOM());
View Full Code Here

               + STRING_BUFFER_SIG));
     
      final int toString = cpg.addMethodref(STRING_BUFFER_CLASS,
              "toString",
              "()"+STRING_SIG);
      il.append(new NEW(cpg.addClass(STRING_BUFFER_CLASS)));
      il.append(DUP);
      il.append(new INVOKESPECIAL(initBuffer));
      // StringBuffer is on the stack
      final Enumeration elements = elements();
      while (elements.hasMoreElements()) {
View Full Code Here

  final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
            ADD_ITERATOR,
            ADD_ITERATOR_SIG);

  // Create the UnionIterator and leave it on the stack
  il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
  il.append(DUP);
  il.append(methodGen.loadDOM());
  il.append(new INVOKESPECIAL(init));

  // Add the various iterators to the UnionIterator
View Full Code Here

     */
    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
          ReferenceType type) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
  il.append(DUP_X1);
  il.append(SWAP);
  il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                 "<init>",
                 "(Z)V")));
View Full Code Here

      il.append(new GETFIELD(cpg.addFieldref(className, "_dom",
               DOM_INTF_SIG)));

      // Create a new instance of a StringValueHandler
      int index = cpg.addMethodref(STRING_VALUE_HANDLER, "<init>", "()V");
      il.append(new NEW(cpg.addClass(STRING_VALUE_HANDLER)));
      il.append(DUP);
      il.append(DUP);
      il.append(new INVOKESPECIAL(index));
     
      // Store new Handler into a local variable
View Full Code Here

                methodGen.addLocalVariable("filter_parent_path_tmp2",
                                           Util.getJCRefType(NODE_ITERATOR_SIG),
                                           il.getEnd(), null);
        il.append(new ASTORE(pathTemp.getIndex()));

  il.append(new NEW(cpg.addClass(STEP_ITERATOR_CLASS)));
  il.append(DUP);
        il.append(new ALOAD(filterTemp.getIndex()));
        il.append(new ALOAD(pathTemp.getIndex()));

  // Initialize StepIterator with iterators from the stack
View Full Code Here

          NodeSetType type) {
  ConstantPoolGen cpg = classGen.getConstantPool();
  InstructionList il = methodGen.getInstructionList();

  // Create a new instance of SingletonIterator
  il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
  il.append(DUP_X1);
  il.append(SWAP);
  final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
            "(" + NODE_SIG +")V");
  il.append(new INVOKESPECIAL(init));
View Full Code Here

     */
    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
          ReferenceType type) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  il.append(new NEW(cpg.addClass(RUNTIME_NODE_CLASS)));
  il.append(DUP_X1);
  il.append(SWAP);
  il.append(new PUSH(cpg, _type));
  il.append(new INVOKESPECIAL(cpg.addMethodref(RUNTIME_NODE_CLASS,
                 "<init>", "(II)V")));
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.NEW

Copyright © 2018 www.massapicom. 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.