Examples of New


Examples of org.apache.bcel.generic.NEW

  final int index = cpg.addMethodref(_className, "<init>",
             "(" + TRANSLET_INTF_SIG
             + DOM_INTF_SIG
             + NODE_ITERATOR_SIG
             + ")V");
  il.append(new NEW(cpg.addClass(_className)));
  il.append(DUP);
  il.append(classGen.loadTranslet());
  il.append(methodGen.loadDOM());
  il.append(methodGen.loadIterator());
  il.append(new INVOKESPECIAL(index));
View Full Code Here

Examples of org.apache.bcel.generic.NEW

     */
    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(DOUBLE_CLASS)));
  il.append(DUP_X2);
  il.append(DUP_X2);
  il.append(POP);
  il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
                 "<init>", "(D)V")));
View Full Code Here

Examples of org.apache.bcel.generic.NEW

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

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

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

Examples of org.apache.bcel.generic.NEW

  // Compile auxiliary class for filter
  compileFilter(classGen, methodGen);
 
  // Create new instance of filter
  il.append(new NEW(cpg.addClass(_className)));
  il.append(DUP);
  il.append(new INVOKESPECIAL(cpg.addMethodref(_className,
                 "<init>", "()V")));

  // Initialize closure variables
View Full Code Here

Examples of org.apache.bcel.generic.NEW

  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

Examples of org.apache.bcel.generic.NEW

  il.append(classGen.loadTranslet());
  il.append(new PUSH(cpg, _name.toString()));

  // Manufacture a DecimalFormatSymbols on the stack
  // for call to addDecimalFormat()
  il.append(new NEW(cpg.addClass(DFS_CLASS)));
  il.append(DUP);
  il.append(new INVOKESPECIAL(init));

  String tmp = getAttribute("NaN");
  if ((tmp == null) || (tmp.equals(EMPTYSTRING))) {
View Full Code Here

Examples of org.apache.bcel.generic.NEW

  il.append(classGen.loadTranslet());
  il.append(new PUSH(cpg, EMPTYSTRING));

  // Manufacture a DecimalFormatSymbols on the stack
  // for call to addDecimalFormat()
  il.append(new NEW(cpg.addClass(DFS_CLASS)));
  il.append(DUP);
  il.append(new INVOKESPECIAL(init));

  int nan = cpg.addMethodref(DFS_CLASS,
           "setNaN", "(Ljava/lang/String;)V");
View Full Code Here

Examples of org.apache.bcel.generic.NEW

  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));

  // Overwrite old handler with DOM handler
  index = cpg.addMethodref(DOM_IMPL,
         "getOutputDomBuilder",
         "()" + TRANSLET_OUTPUT_SIG);

  il.append(new INVOKEVIRTUAL(index));
  il.append(DUP);
  il.append(methodGen.storeHandler());

  // Call startDocument on the new handler
  il.append(methodGen.startDocument());

  // Instantiate result tree fragment
  translateContents(classGen, methodGen);

  // Call endDocument on the new handler
  il.append(methodGen.loadHandler());
  il.append(methodGen.endDocument());

  // Check if we need to wrap the DOMImpl object in a DOMAdapter object
  if (!DOM_CLASS.equals(DOM_IMPL_CLASS)) {
      // new org.apache.xalan.xsltc.dom.DOMAdapter(DOMImpl,String[]);
      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

Examples of org.apache.bcel.generic.NEW

    }
    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

Examples of org.apache.bcel.generic.NEW

      // 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));
      }
      else {
    idx = cpg.addMethodref(CURRENT_NODE_LIST_ITERATOR,
               "<init>",
               "("
               + NODE_ITERATOR_SIG
               + 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
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.