Examples of INVOKEVIRTUAL


Examples of org.apache.bcel.generic.INVOKEVIRTUAL

      if ((path == Axis.DESCENDANTORSELF && step == Axis.CHILD) ||
    (path == Axis.PRECEDING        && step == Axis.PARENT)) {
    final int incl = cpg.addMethodref(NODE_ITERATOR_BASE,
              "includeSelf",
              "()" + NODE_ITERATOR_SIG);
    il.append(new INVOKEVIRTUAL(incl));
      }
  }

  /*
   * If this pattern contains a sequence of descendant iterators we
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

  default:
      final int initBuffer = cpg.addMethodref(STRING_BUFFER_CLASS,
                "<init>", "()V");
      final Instruction append =
    new INVOKEVIRTUAL(cpg.addMethodref(STRING_BUFFER_CLASS,
               "append",
               "("+STRING_SIG+")"
               +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));
      for (int i = 0; i < nArgs; i++) {
    argument(i).translate(classGen, methodGen);
    il.append(append);
      }
      il.append(new INVOKEVIRTUAL(toString));
  }
    }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

  final BranchHandle ifBlock1 = il.append(new IFNULL(null));

  // Get the length of the node name and save for later
  il.append(new ALOAD(name.getIndex()));
  final int lengthMethod = cpg.addMethodref(STRING_CLASS,"length","()I");
  il.append(new INVOKEVIRTUAL(lengthMethod));
  length.setStart(il.append(new ISTORE(length.getIndex())));

  // Copy in attribute sets if specified
  if (_useSets != null) {
      // If the parent of this element will result in an element being
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

    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));
    il.append(POP);    // ignore mask returned by addDOMAdapter
      }
  }

  // Restore old handler base from stack
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

  if ((tmp == null) || (tmp.equals(EMPTYSTRING))) {
      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));
  }

  tmp = getAttribute("infinity");
  if ((tmp == null) || (tmp.equals(EMPTYSTRING))) {
      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));
  }
     
  final int nAttributes = _attributes.getLength();
  for (int i = 0; i < nAttributes; i++) {
      final String name = _attributes.getQName(i);
      final String value = _attributes.getValue(i);

      boolean valid = true;
      int method = 0;

      if (name.equals("decimal-separator")) {
    // DecimalFormatSymbols.setDecimalSeparator();
    method = cpg.addMethodref(DFS_CLASS,
            "setDecimalSeparator", "(C)V");
      }
      else if (name.equals("grouping-separator")) {
    method =  cpg.addMethodref(DFS_CLASS,
             "setGroupingSeparator", "(C)V");
      }
      else if (name.equals("minus-sign")) {
    method = cpg.addMethodref(DFS_CLASS,
            "setMinusSign", "(C)V");
      }
      else if (name.equals("percent")) {
    method = cpg.addMethodref(DFS_CLASS,
            "setPercent", "(C)V");
      }
      else if (name.equals("per-mille")) {
    method = cpg.addMethodref(DFS_CLASS,
            "setPerMill", "(C)V");
      }
      else if (name.equals("zero-digit")) {
    method = cpg.addMethodref(DFS_CLASS,
            "setZeroDigit", "(C)V");
      }
      else if (name.equals("digit")) {
    method = cpg.addMethodref(DFS_CLASS,
            "setDigit", "(C)V");
      }
      else if (name.equals("pattern-separator")) {
    method = cpg.addMethodref(DFS_CLASS,
            "setPatternSeparator", "(C)V");
      }
      else if (name.equals("NaN")) {
    method = cpg.addMethodref(DFS_CLASS,
            "setNaN", "(Ljava/lang/String;)V");
          il.append(DUP);
    il.append(new PUSH(cpg, value));
    il.append(new INVOKEVIRTUAL(method));
    valid = false;
      }
      else if (name.equals("infinity")) {
    method = cpg.addMethodref(DFS_CLASS,
            "setInfinity",
            "(Ljava/lang/String;)V");
          il.append(DUP);
    il.append(new PUSH(cpg, value));
    il.append(new INVOKEVIRTUAL(method));
    valid = false;
      }
      else {
    valid = false;
      }

      if (valid) {
    il.append(DUP);
    il.append(new PUSH(cpg, value.charAt(0)));
    il.append(new INVOKEVIRTUAL(method));
      }

  }

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

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

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

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

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

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

            // translate contents with substituted handler
            translateContents(classGen, methodGen);

            // get String out of the handler
            il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_VALUE_HANDLER,
                                                         "getValue",
                                                         "()" + STRING_SIG)));
            // call "comment"
            final int comment =
                        cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

                    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                              "endDocument",
                                              "()V"), 1));

                // Call toString() on StringWriter
                il.append(new INVOKEVIRTUAL(
                    cpg.addMethodref(STRING_WRITER, "toString",
                                     "()" + STRING_SIG)));

                // Restore old output handler
                il.append(SWAP);
                il.append(methodGen.storeHandler());
            break;
        }

  // Send the resulting string to the message handling method
  il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
                 "displayMessage",
                 "("+STRING_SIG+")V")));

  // If 'terminate' attribute is set to 'yes': Instanciate a
  // RunTimeException, but it on the stack and throw an exception
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  _base.translate(classGen, methodGen);
  _token.translate(classGen, methodGen);
  il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
                 "startsWith",
                 "("+STRING_SIG+")Z")));
    }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEVIRTUAL

        if (stylesheet.hasLocalParams()) {
            il.append(classGen.loadTranslet());
            final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
                                                   PUSH_PARAM_FRAME,
                                                   PUSH_PARAM_FRAME_SIG);
            il.append(new INVOKEVIRTUAL(pushFrame));
        }

  // Get the [min,max> precedence of all templates imported under the
  // current stylesheet
  final int maxPrecedence = _precedence;
  final int minPrecedence = getMinPrecedence(maxPrecedence);
  final Mode mode = stylesheet.getMode(_modeName);

        // Get name of appropriate apply-templates function for this
        // xsl:apply-imports instruction
  String functionName = mode.functionName(minPrecedence, maxPrecedence);

  // Construct the translet class-name and the signature of the method
  final String className = classGen.getStylesheet().getClassName();
  final String signature = classGen.getApplyTemplatesSigForImport();
  final int applyTemplates = cpg.addMethodref(className,
                functionName,
                signature);
  il.append(new INVOKEVIRTUAL(applyTemplates));

        // Pop any parameter frame that was pushed above.
        if (stylesheet.hasLocalParams()) {
            il.append(classGen.loadTranslet());
            final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
                                                   POP_PARAM_FRAME,
                                                   POP_PARAM_FRAME_SIG);
            il.append(new INVOKEVIRTUAL(pushFrame));
        }
    }
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.