Package com.sun.org.apache.bcel.internal.generic

Examples of com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE


  // Get the parent of the node on the stack
  il.append(methodGen.loadDOM());
  il.append(new ILOAD(node.getIndex()));
  int index = cpg.addInterfaceMethodref(DOM_INTF,
                GET_PARENT, GET_PARENT_SIG);
  il.append(new INVOKEINTERFACE(index, 2));

  // Initialize the iterator with the parent
  il.append(new ALOAD(iter.getIndex()));
  il.append(SWAP);
  il.append(methodGen.setStartNode());
View Full Code Here


      if (_thisArgument != null && _clazz.isInterface()) {
          index = cpg.addInterfaceMethodref(clazz,
             _fname.getLocalPart(),
             buffer.toString());
    il.append(new INVOKEINTERFACE(index, n+1));
            }
            else {
          index = cpg.addMethodref(clazz,
             _fname.getLocalPart(),
             buffer.toString());
View Full Code Here

  final int getName = cpg.addInterfaceMethodref(DOM_INTF,
                  GET_NODE_NAME,
                  GET_NODE_NAME_SIG);
  super.translate(classGen, methodGen);
  il.append(new INVOKEINTERFACE(getName, 2));
    }
View Full Code Here

                rawText.loadAsArrayOffsetLength(classGen, methodGen);
                final int comment =
                        cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                                  "comment",
                                                  "([CII)V");
                il.append(new INVOKEINTERFACE(comment, 4));
            } else {
                il.append(new PUSH(cpg, rawText.getText()));
                final int comment =
                        cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                                  "comment",
                                                  "(" + STRING_SIG + ")V");
                il.append(new INVOKEINTERFACE(comment, 2));
            }
        } else {
            // Save the current handler base on the stack
            il.append(methodGen.loadHandler());
            il.append(DUP);             // first arg to "comment" call

            // Get the translet's StringValueHandler
            il.append(classGen.loadTranslet());
            il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
                                                   "stringValueHandler",
                                                   STRING_VALUE_HANDLER_SIG)));
            il.append(DUP);
            il.append(methodGen.storeHandler());

            // 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,
                                                  "comment",
                                                  "(" + STRING_SIG + ")V");
            il.append(new INVOKEINTERFACE(comment, 2));
            // Restore old handler base from stack
            il.append(methodGen.storeHandler());
        }
    }
View Full Code Here

            final int index = cpg.addInterfaceMethodref(NODE_ITERATOR,
                                                       "getPosition",
                                                       "()I");

      il.append(methodGen.loadIterator());
            il.append(new INVOKEINTERFACE(index,1));
  }
    }
View Full Code Here

             + NODE_ITERATOR_SIG);
  il.append(new INVOKESTATIC(index));

  // Reset this iterator
  index = cpg.addInterfaceMethodref(NODE_ITERATOR, RESET, RESET_SIG);
  il.append(new INVOKEINTERFACE(index, 1));
    }
View Full Code Here

  }

  final int getParent = cpg.addInterfaceMethodref(DOM_INTF,
              GET_PARENT,
              GET_PARENT_SIG);
  il.append(new INVOKEINTERFACE(getParent, 2));

  final SyntaxTreeNode p = getParent();
  if (p == null || p instanceof Instruction ||
      p instanceof TopLevelElement)
  {
View Full Code Here

        // Feck the this pointer on the stack...
        il.append(methodGen.loadDOM());
        // ...then the entity name...
        _entity.translate(classGen, methodGen);
        // ...to get the URI from the DOM object.
        il.append(new INVOKEINTERFACE(
                         cpg.addInterfaceMethodref(DOM_INTF,
                                                   GET_UNPARSED_ENTITY_URI,
                                                   GET_UNPARSED_ENTITY_URI_SIG),
                         2));
    }
View Full Code Here

      il.append(methodGen.loadDOM());
      il.append(SWAP); // dom ref must be below node index
      int index = cpg.addInterfaceMethodref(DOM_INTF,
              GET_ELEMENT_VALUE,
              GET_ELEMENT_VALUE_SIG);
      il.append(new INVOKEINTERFACE(index, 2));
      break;

  case NodeTest.ANODE:
  case NodeTest.COMMENT:
  case NodeTest.ATTRIBUTE:
  case NodeTest.PI:
      il.append(methodGen.loadDOM());
      il.append(SWAP); // dom ref must be below node index
      index = cpg.addInterfaceMethodref(DOM_INTF,
                GET_NODE_VALUE,
                GET_NODE_VALUE_SIG);
      il.append(new INVOKEINTERFACE(index, 2));
      break;
     
  default:
      ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
          toString(), type.toString());
View Full Code Here

        if (className.equals("org.w3c.dom.Node") ||
            className.equals("java.lang.Object")) {
      int index = cpg.addInterfaceMethodref(DOM_INTF,
              MAKE_NODE,
              MAKE_NODE_SIG);
      il.append(new INVOKEINTERFACE(index, 2));
  }
  else if (className.equals("org.w3c.dom.NodeList")) {
      int index = cpg.addInterfaceMethodref(DOM_INTF,
              MAKE_NODE_LIST,
              MAKE_NODE_LIST_SIG);
      il.append(new INVOKEINTERFACE(index, 2));
  }
  else {
      ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
          toString(), className);
      classGen.getParser().reportError(Constants.FATAL, err);
View Full Code Here

TOP

Related Classes of com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE

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.