Package org.apache.bcel.generic

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


  // 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");
  il.append(DUP);
  il.append(new PUSH(cpg, "NaN"));
  il.append(new INVOKEVIRTUAL(nan));
View Full Code Here


           "setNaN", "(Ljava/lang/String;)V");
  il.append(DUP);
  il.append(new PUSH(cpg, "NaN"));
  il.append(new INVOKEVIRTUAL(nan));

  int inf = cpg.addMethodref(DFS_CLASS,
           "setInfinity",
           "(Ljava/lang/String;)V");
  il.append(DUP);
  il.append(new PUSH(cpg, "Infinity"));
  il.append(new INVOKEVIRTUAL(inf));
View Full Code Here

           "(Ljava/lang/String;)V");
  il.append(DUP);
  il.append(new PUSH(cpg, "Infinity"));
  il.append(new INVOKEVIRTUAL(inf));

  final int put = cpg.addMethodref(TRANSLET_CLASS,
           "addDecimalFormat",
           "("+STRING_SIG+DFS_SIG+")V");
  il.append(new INVOKEVIRTUAL(put));
    }
}
View Full Code Here

    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  final int setEscaping = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
                "setEscaping","(Z)Z");
  final int characters = cpg.addMethodref(TRANSLET_CLASS,
            CHARACTERSW,
            CHARACTERSW_SIG);

  // Turn off character escaping if so is wanted.
  if (!_escaping) {
View Full Code Here

               DOM_FIELD,
               DOM_INTF_SIG);
  final String docParamList =
      "("+OBJECT_SIG+STRING_SIG+STRING_SIG+TRANSLET_SIG+DOM_INTF_SIG+")"+
      NODE_ITERATOR_SIG;
  final int docIdx = cpg.addMethodref(LOAD_DOCUMENT_CLASS,
              "document", docParamList);

  final int uriIdx = cpg.addInterfaceMethodref(DOM_INTF,
                 "getDocumentURI",
                 "(I)"+STRING_SIG);
View Full Code Here

      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

  final InstructionList il = methodGen.getInstructionList();


  if (stylesheet.hasLocalParams() || hasContents()) {
      // 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
View Full Code Here

  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

                 +")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

  final InstructionList il = new InstructionList();
  final String applyTemplatesSig = classGen.getApplyTemplatesSig();
  final int git = cpg.addInterfaceMethodref(DOM_INTF,
              GET_CHILDREN,
              GET_CHILDREN_SIG);
  final int applyTemplates = cpg.addMethodref(getClassName(),
                functionName(),
                applyTemplatesSig);
  il.append(classGen.loadTranslet());
  il.append(methodGen.loadDOM());
 
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.