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

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


            _arg2.translate(classGen, methodGen);
            _arg2.startIterator(classGen, methodGen);      
        }
   
        // Feck the rest of the parameters on the stack
        il.append(new PUSH(cpg, getStylesheet().getSystemId()));
        il.append(classGen.loadTranslet());
        il.append(DUP);
        il.append(new GETFIELD(domField));
        il.append(new INVOKESTATIC(docIdx));
    }
View Full Code Here


                                                          "setEscaping","(Z)Z");

        // Turn off character escaping if so is wanted.
        if (!_escaping) {
            il.append(methodGen.loadHandler());
            il.append(new PUSH(cpg,false));
            il.append(new INVOKEINTERFACE(setEscaping,2));
        }

        // Translate the contents.  If the value is a string, use the
        // translet.characters(String, TranslatOutputHandler) method.
View Full Code Here

  il.append(new INVOKEVIRTUAL(cpg.addMethodref(_javaClassName,
                "toString",
                "()" + STRING_SIG)));
  final BranchHandle gotobh = il.append(new GOTO(null));
  ifNull.setTarget(il.append(POP));
  il.append(new PUSH(cpg, ""));
  gotobh.setTarget(il.append(NOP));
    }
View Full Code Here

    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
          StringType type) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  final BranchHandle falsec = il.append(new IFEQ(null));
  il.append(new PUSH(cpg, "true"));
  final BranchHandle truec = il.append(new GOTO(null));
  falsec.setTarget(il.append(new PUSH(cpg, "false")));
  truec.setTarget(il.append(NOP));
    }
View Full Code Here

                "getExpandedTypeID",
                                                          "(I)I");
      il.append(methodGen.loadDOM());
      il.append(SWAP);
      il.append(new INVOKEINTERFACE(getEType, 2));
      il.append(new PUSH(cpg, _nodeType));
 
      // Need to allow for long jumps here
      final BranchHandle icmp = il.append(new IF_ICMPEQ(null));
      _falseList.add(il.append(new GOTO_W(null)));
      icmp.setTarget(il.append(NOP));
View Full Code Here

  // Only update _version field if set and different from default
  if ((_version != null) && (!_version.equals(XML_VERSION))) {
      field = cpg.addFieldref(TRANSLET_CLASS, "_version", STRING_SIG);
      il.append(DUP);
      il.append(new PUSH(cpg, _version));
      il.append(new PUTFIELD(field));
  }

  // Only update _method field if "method" attribute used
  if (_method != null) {
      field = cpg.addFieldref(TRANSLET_CLASS, "_method", STRING_SIG);
      il.append(DUP);
      il.append(new PUSH(cpg, _method));
      il.append(new PUTFIELD(field));
  }

  // Only update if _encoding field is "encoding" attribute used
  if (_encoding != null) {
      field = cpg.addFieldref(TRANSLET_CLASS, "_encoding", STRING_SIG);
      il.append(DUP);
      il.append(new PUSH(cpg, _encoding));
      il.append(new PUTFIELD(field));
  }

  // Only update if "omit-xml-declaration" used and set to 'yes'
  if (_omitHeader) {
      field = cpg.addFieldref(TRANSLET_CLASS, "_omitHeader", "Z");
      il.append(DUP);
      il.append(new PUSH(cpg, _omitHeader));
      il.append(new PUTFIELD(field));
  }

  // Add 'standalone' decaration to output - use text as is
  if (_standalone != null) {
      field = cpg.addFieldref(TRANSLET_CLASS, "_standalone", STRING_SIG);
      il.append(DUP);
      il.append(new PUSH(cpg, _standalone));
      il.append(new PUTFIELD(field));
  }

  // Set system/public doctype only if both are set
  field = cpg.addFieldref(TRANSLET_CLASS,"_doctypeSystem",STRING_SIG);
  il.append(DUP);
  il.append(new PUSH(cpg, _doctypeSystem));
  il.append(new PUTFIELD(field));
  field = cpg.addFieldref(TRANSLET_CLASS,"_doctypePublic",STRING_SIG);
  il.append(DUP);
  il.append(new PUSH(cpg, _doctypePublic));
  il.append(new PUTFIELD(field));
 
  // Add 'medye-type' decaration to output - if used
  if (_mediaType != null) {
      field = cpg.addFieldref(TRANSLET_CLASS, "_mediaType", STRING_SIG);
      il.append(DUP);
      il.append(new PUSH(cpg, _mediaType));
      il.append(new PUTFIELD(field));
  }

  // Compile code to set output indentation on/off
  if (_indent) {
      field = cpg.addFieldref(TRANSLET_CLASS, "_indent", "Z");
      il.append(DUP);
      il.append(new PUSH(cpg, _indent));
      il.append(new PUTFIELD(field));
  }

        //Compile code to set indent amount.
        if(_indentamount != null && !_indentamount.equals(EMPTYSTRING)){
            field = cpg.addFieldref(TRANSLET_CLASS, "_indentamount", "I");
      il.append(DUP);
      il.append(new PUSH(cpg, Integer.parseInt(_indentamount)));
      il.append(new PUTFIELD(field));
        }
       
  // Forward to the translet any elements that should be output as CDATA
  if (_cdata != null) {
      int index = cpg.addMethodref(TRANSLET_CLASS,
           "addCdataElement",
           "(Ljava/lang/String;)V");

      StringTokenizer tokens = new StringTokenizer(_cdata);
      while (tokens.hasMoreTokens()) {
    il.append(DUP);
    il.append(new PUSH(cpg, tokens.nextToken()));
    il.append(new INVOKEVIRTUAL(index));
      }
  }
  il.append(POP); // Cleanup - pop last translet reference off stack
    }
View Full Code Here

                                                           "(I)"+NODE_SIG);

        // Call getKeyIndex in AbstractTranslet with the name of the key
        // to get the index for this key (which is also a node iterator).
        il.append(classGen.loadTranslet());
        il.append(new PUSH(cpg,_index));
        il.append(new INVOKEVIRTUAL(getKeyIndex));

        // Now use the value in the second argument to determine what nodes
        // the iterator should return.
        il.append(SWAP);
        il.append(new PUSH(cpg,_value));
        if (this instanceof IdPattern)
        {
            il.append(new INVOKEVIRTUAL(lookupId));
        }
        else
View Full Code Here

        final InstructionList il = methodGen.getInstructionList();
        final int nArgs = argumentCount();

        switch (nArgs) {
        case 0:
            il.append(new PUSH(cpg, EMPTYSTRING));
            break;

        case 1:
            argument().translate(classGen, methodGen);
            break;
View Full Code Here

                                                          "getExpandedTypeID",
                                                          "(I)I");
            il.append(methodGen.loadDOM());
            il.append(methodGen.loadCurrentNode());
            il.append(new INVOKEINTERFACE(getType, 2));
            il.append(new PUSH(cpg, DTM.PROCESSING_INSTRUCTION_NODE));
            _falseList.add(il.append(new IF_ICMPEQ(null)));
        }

        // Load the requested processing instruction name
        il.append(new PUSH(cpg, _name));
        // Load the current processing instruction's name
        il.append(methodGen.loadDOM());
        il.append(methodGen.loadCurrentNode());
        il.append(new INVOKEINTERFACE(gname, 2));
        // Compare the two strings
View Full Code Here

        }
        // If neither are present then store empty string in parameter slot
        else {
            final ConstantPoolGen cpg = classGen.getConstantPool();
            final InstructionList il = methodGen.getInstructionList();
            il.append(new PUSH(cpg, Constants.EMPTYSTRING));
        }
    }
View Full Code Here

TOP

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

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.