Examples of INVOKESPECIAL


Examples of org.apache.bcel.generic.INVOKESPECIAL

        null, null, "<init>",
        _className, il, cpg);

  // Call the constructor in the AbstractTranslet superclass
  il.append(classGen.loadTranslet());
  il.append(new INVOKESPECIAL(cpg.addMethodref(TRANSLET_CLASS,
                 "<init>", "()V")));
 
        constructor.markChunkStart();
  il.append(classGen.loadTranslet());
  il.append(new GETSTATIC(cpg.addFieldref(_className,
View Full Code Here

Examples of org.apache.bcel.generic.INVOKESPECIAL

  if (isMultiDocument()) {
      final int init = cpg.addMethodref(MULTI_DOM_CLASS,
                "<init>",
                "("+DOM_INTF_SIG+")V");
      il.append(new INVOKESPECIAL(init));
      // MultiDOM is on the stack
  }
 
  //store to _dom variable
  il.append(new PUTFIELD(domField));
View Full Code Here

Examples of org.apache.bcel.generic.INVOKESPECIAL

        pathTemp.setEnd(il.append(new ALOAD(pathTemp.getIndex())));
        stepTemp.setEnd(il.append(new ALOAD(stepTemp.getIndex())));

  // Initialize StepIterator with iterators from the stack
  il.append(new INVOKESPECIAL(initSI));

  // This is a special case for the //* path with or without predicates
  Expression stp = _step;
  if (stp instanceof ParentLocationPath)
      stp = ((ParentLocationPath)stp).getStep();
View Full Code Here

Examples of org.apache.bcel.generic.INVOKESPECIAL

              "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.INVOKESPECIAL

    il.append(methodGen.loadDOM());
    il.append(methodGen.loadIterator());
    il.append(methodGen.loadHandler());
    final int method = cpg.addMethodref(classGen.getClassName(),
                methodName, ATTR_SET_SIG);
    il.append(new INVOKESPECIAL(method));
      }
      // Generate an error if the attribute set does not exist
      else {
    final Parser parser = getParser();
    final String atrs = name.toString();
View Full Code Here

Examples of org.apache.bcel.generic.INVOKESPECIAL

              +")V");
          il.append(new NEW(cpg.addClass(CACHED_NODE_LIST_ITERATOR_CLASS)));
          il.append(DUP_X1);
          il.append(SWAP);

          il.append(new INVOKESPECIAL(initCNI));
      }
      _select.startIterator(classGen, methodGen);
  }
  // If not, compile result tree from parameter body if present.
  else if (hasContents()) {
View Full Code Here

Examples of org.apache.bcel.generic.INVOKESPECIAL

    il.append(DUP);
    il.append(DUP);
    il.append(new ICONST(0));
    il.append(new NEWARRAY(BasicType.INT));
    il.append(SWAP);
    il.append(new INVOKESPECIAL(index));
      }
      else {
    // Push name arrays on the stack
    il.append(ALOAD_0);
    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
             NAMES_INDEX,
             NAMES_INDEX_SIG)));
    il.append(ALOAD_0);
    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
             URIS_INDEX,
             URIS_INDEX_SIG)));
    il.append(ALOAD_0);
    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
             TYPES_INDEX,
             TYPES_INDEX_SIG)));
    il.append(ALOAD_0);
    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
             NAMESPACE_INDEX,
             NAMESPACE_INDEX_SIG)));

    // Initialized DOM adapter
    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())));
View Full Code Here

Examples of org.apache.bcel.generic.INVOKESPECIAL

        // 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))) {
      int nan = cpg.addMethodref(DFS_CLASS,
               "setNaN", "(Ljava/lang/String;)V");
View Full Code Here

Examples of org.apache.bcel.generic.INVOKESPECIAL

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

Examples of org.apache.bcel.generic.INVOKESPECIAL

                // Push a reference to a StringWriter
                il.append(new NEW(cpg.addClass(STRING_WRITER)));
                il.append(DUP);
                il.append(DUP);
                il.append(new INVOKESPECIAL(
                    cpg.addMethodref(STRING_WRITER, "<init>", "()V")));

                // Load ToXMLStream
                il.append(methodGen.loadHandler());
                il.append(new INVOKESPECIAL(
                    cpg.addMethodref(STREAM_XML_OUTPUT, "<init>",
                                     "()V")));

                // Invoke output.setWriter(STRING_WRITER)
                il.append(methodGen.loadHandler());
                il.append(SWAP);
                il.append(new INVOKEINTERFACE(
                    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                              "setWriter",
                                              "("+WRITER_SIG+")V"), 2));

                // Invoke output.setEncoding("UTF-8")
                il.append(methodGen.loadHandler());
                il.append(new PUSH(cpg, "UTF-8"));   // other encodings?
                il.append(new INVOKEINTERFACE(
                    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                              "setEncoding",
                                              "("+STRING_SIG+")V"), 2));

                // Invoke output.setOmitXMLDeclaration(true)
                il.append(methodGen.loadHandler());
                il.append(ICONST_1);
                il.append(new INVOKEINTERFACE(
                    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                              "setOmitXMLDeclaration",
                                              "(Z)V"), 2));

                il.append(methodGen.loadHandler());
                il.append(new INVOKEINTERFACE(
                    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                              "startDocument",
                                              "()V"), 1));

                // Inline translation of contents
                translateContents(classGen, methodGen);

                il.append(methodGen.loadHandler());
                il.append(new INVOKEINTERFACE(
                    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
  if (_terminate == true) {
      // Create a new instance of RunTimeException
      final int einit = cpg.addMethodref("java.lang.RuntimeException",
                 "<init>",
                 "(Ljava/lang/String;)V");
      il.append(new NEW(cpg.addClass("java.lang.RuntimeException")));
      il.append(DUP);
      il.append(new PUSH(cpg,"Termination forced by an " +
                 "xsl:message instruction"));
      il.append(new INVOKESPECIAL(einit));
      il.append(ATHROW);
  }
    }
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.