Package org.apache.bcel.generic

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


  final String DOM_CLASS = classGen.getDOMClass();

  // Create new instance of DOM class
  int index = cpg.addMethodref(DOM_IMPL, "<init>", "(I)V");
  il.append(new NEW(cpg.addClass(DOM_IMPL)));
  il.append(DUP);
  il.append(DUP);
  il.append(new PUSH(cpg, RTF_INITIAL_SIZE));
  il.append(new INVOKESPECIAL(index));
View Full Code Here


      index = cpg.addMethodref(DOM_ADAPTER_CLASS,
             "<init>",
             "("+DOM_IMPL_SIG+
             "["+STRING_SIG+
             "["+STRING_SIG+")V");
      il.append(new NEW(cpg.addClass(DOM_ADAPTER_CLASS)));
      il.append(new DUP_X1());
      il.append(SWAP);

      /*
       * Give the DOM adapter an empty type mapping if the nodeset
View Full Code Here

       * Give the DOM adapter an empty type mapping if the nodeset
       * extension function is never called.
       */
      if (!stylesheet.callsNodeset()) {
    il.append(new ICONST(0));
    il.append(new ANEWARRAY(cpg.addClass(STRING)));
    il.append(DUP);
    il.append(new INVOKESPECIAL(index));
      }
      else {
    // Push name arrays on the stack
View Full Code Here

    il.append(new INVOKESPECIAL(index));

    // Add DOM adapter to MultiDOM class by calling addDOMAdapter()
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new CHECKCAST(cpg.addClass(classGen.getDOMClass())));
    il.append(SWAP);
    index = cpg.addMethodref(MULTI_DOM_CLASS,
           "addDOMAdapter",
           "(" + DOM_ADAPTER_SIG + ")I");
    il.append(new INVOKEVIRTUAL(index));
View Full Code Here

    }
    else {
        // Wrap the context node in a singleton iterator if not.
        int init = cpg.addMethodref(SINGLETON_ITERATOR,
            "<init>", "("+NODE_SIG+")V");
        il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
        il.append(DUP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKESPECIAL(init));
    }
    return;
View Full Code Here

      // Handle 'elem[n]' expression
      else if (predicate.isNthPositionFilter()) {
    idx = cpg.addMethodref(NTH_ITERATOR_CLASS,
               "<init>",
               "("+NODE_ITERATOR_SIG+"I)V");
    il.append(new NEW(cpg.addClass(NTH_ITERATOR_CLASS)));
    il.append(DUP);
    translatePredicates(classGen, methodGen); // recursive call
    predicate.translate(classGen, methodGen);
    il.append(new INVOKESPECIAL(idx));
      }
View Full Code Here

               + CURRENT_NODE_LIST_FILTER_SIG
               + NODE_SIG
               + TRANSLET_SIG
               + ")V");
    // create new CurrentNodeListIterator
    il.append(new NEW(cpg.addClass(CURRENT_NODE_LIST_ITERATOR)));
    il.append(DUP);
    translatePredicates(classGen, methodGen); // recursive call
    predicate.translateFilter(classGen, methodGen);
   
    il.append(methodGen.loadCurrentNode());
View Full Code Here

   
    il.append(methodGen.loadCurrentNode());
    il.append(classGen.loadTranslet());
    if (classGen.isExternal()) {
        final String className = classGen.getClassName();
        il.append(new CHECKCAST(cpg.addClass(className)));
    }
    il.append(new INVOKESPECIAL(idx));
      }
  }
    }
View Full Code Here

  // Put the names array into the translet - used for dom/translet mapping
  final Vector names = getXSLTC().getNamesIndex();
  il.append(classGen.loadTranslet());
  il.append(new PUSH(cpg, names.size()));
  il.append(new ANEWARRAY(cpg.addClass(STRING)));   

  for (int i = 0; i < names.size(); i++) {
      final String name = (String)names.elementAt(i);
      il.append(DUP);
      il.append(new PUSH(cpg, i));
View Full Code Here

  // Put the namespace names array into the translet
  final Vector namespaces = getXSLTC().getNamespaceIndex();
  il.append(classGen.loadTranslet());
  il.append(new PUSH(cpg, namespaces.size()));
  il.append(new ANEWARRAY(cpg.addClass(STRING)));   

  for (int i = 0; i < namespaces.size(); i++) {
      final String ns = (String)namespaces.elementAt(i);
      il.append(DUP);
      il.append(new PUSH(cpg, i));
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.