Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.GETSTATIC


                        int index = getIndex(field);
                        if (field.isStatic()) {
                            if (isSetter) {
                                replacement = new PUTSTATIC(index);
                            } else {
                                replacement = new GETSTATIC(index);
                            }
                        } else {
                            if (isSetter) {
                                replacement = new PUTFIELD(index);
                            } else {
View Full Code Here


           new Type[] {
             new ObjectType("java.awt.event.ActionEvent")
           }, null, "actionPerformed", "foo", il, cp);

      // System.out.println("actionPerformed:" + event);
      il.append(new GETSTATIC(out));
      il.append(factory.createNew("java.lang.StringBuffer"));
      il.append(InstructionConstants.DUP);
      il.append(new PUSH(cp, "actionPerformed:"));
      il.append(factory.createInvoke("java.lang.StringBuffer", "<init>", Type.VOID,
             new Type[] {Type.STRING}, Constants.INVOKESPECIAL));
View Full Code Here

     */
    String mesg = "Hello from " + Utility.methodSignatureToString(m.getSignature(),
                  name,
                  Utility.accessToString(flags));
    InstructionList patch  = new InstructionList();
    patch.append(new GETSTATIC(out));
    patch.append(new PUSH(cp, mesg));
    patch.append(new INVOKEVIRTUAL(println));
   
    MethodGen           mg  = new MethodGen(m, class_name, cp);
    InstructionList     il  = mg.getInstructionList();
View Full Code Here

  il.append(InstructionConstants.POP); pop(); // Remove last element on stack
  end = il.append(InstructionConstants.RETURN); // Use instruction constants, if possible

  // catch
  handler = il.append(new ASTORE(slot)); // save exception object
  il.append(new GETSTATIC(cp.addFieldref("java.lang.System", "err",
                 "Ljava/io/PrintStream;")));
  il.append(new ALOAD(slot)); push(2);
  il.append(new INVOKEVIRTUAL(cp.addMethodref("java.io.PrintStream",
            "println",
            "(Ljava/lang/Object;)V")));
View Full Code Here

        final int offset = xsltc.addCharacterData(_text);
        final int length = _text.length();
        String charDataFieldName =
            STATIC_CHAR_DATA_FIELD + (xsltc.getCharacterDataCount()-1);

        il.append(new GETSTATIC(cpg.addFieldref(xsltc.getClassName(),
                                       charDataFieldName,
                                       STATIC_CHAR_DATA_FIELD_SIG)));
        il.append(new PUSH(cpg, offset));
        il.append(new PUSH(cpg, _text.length()));
    }
View Full Code Here

  // for call to addDecimalFormat()
        // Use the US Locale as the default, as most of its settings
        // are equivalent to the default settings required of
  il.append(new NEW(cpg.addClass(DFS_CLASS)));
  il.append(DUP);
        il.append(new GETSTATIC(cpg.addFieldref(LOCALE_CLASS, "US",
                                                LOCALE_SIG)));
  il.append(new INVOKESPECIAL(init));

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

        // default, as most of its settings are equivalent to
        // the default settings required of xsl:decimal-format -
        // except for the NaN and infinity attributes.
  il.append(new NEW(cpg.addClass(DFS_CLASS)));
  il.append(DUP);
        il.append(new GETSTATIC(cpg.addFieldref(LOCALE_CLASS, "US",
                                                LOCALE_SIG)));
  il.append(new INVOKESPECIAL(init));

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

        final int offset = xsltc.addCharacterData(_text);
        final int length = _text.length();
        String charDataFieldName =
            STATIC_CHAR_DATA_FIELD + (xsltc.getCharacterDataCount()-1);

        il.append(new GETSTATIC(cpg.addFieldref(xsltc.getClassName(),
                                       charDataFieldName,
                                       STATIC_CHAR_DATA_FIELD_SIG)));
        il.append(new PUSH(cpg, offset));
        il.append(new PUSH(cpg, _text.length()));
    }
View Full Code Here

  // for call to addDecimalFormat()
        // Use the US Locale as the default, as most of its settings
        // are equivalent to the default settings required of
  il.append(new NEW(cpg.addClass(DFS_CLASS)));
  il.append(DUP);
        il.append(new GETSTATIC(cpg.addFieldref(LOCALE_CLASS, "US",
                                                LOCALE_SIG)));
  il.append(new INVOKESPECIAL(init));

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

        // default, as most of its settings are equivalent to
        // the default settings required of xsl:decimal-format -
        // except for the NaN and infinity attributes.
  il.append(new NEW(cpg.addClass(DFS_CLASS)));
  il.append(DUP);
        il.append(new GETSTATIC(cpg.addFieldref(LOCALE_CLASS, "US",
                                                LOCALE_SIG)));
  il.append(new INVOKESPECIAL(init));

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

TOP

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

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.