Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.PUSH


  if (clazz.getName().equals("java.lang.String")) {
      // same internal representation, convert null to ""
      il.append(DUP);
      final BranchHandle ifNonNull = il.append(new IFNONNULL(null));
      il.append(POP);
      il.append(new PUSH(cpg, ""));
      ifNonNull.setTarget(il.append(NOP));
  }
  else {
      ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
          toString(), clazz.getName());
View Full Code Here


     * @see  org.apache.xalan.xsltc.compiler.util.Type#translateTo
     */
    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
          StringType type) {
  final InstructionList il = methodGen.getInstructionList();
  il.append(new PUSH(classGen.getConstantPool(), ""));
    }
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

      // Create new instance of DOM class
      int index = cpg.addMethodref(DOM_IMPL, "<init>", "(I)V");
      il.append(new NEW(cpg.addClass(DOM_IMPL)));
      il.append(DUP);
      il.append(DUP);
      il.append(new PUSH(cpg, RTF_INITIAL_SIZE));
      il.append(new INVOKESPECIAL(index));
     
      // Store new DOM into a local variable
      newDom = methodGen.addLocalVariable("rt_to_reference_dom",
            Util.getJCRefType(DOM_INTF_SIG),
View Full Code Here

  if (_left instanceof AncestorPattern) { 
      il.append(methodGen.loadDOM());
      il.append(SWAP);
  }
  il.append(new INVOKEINTERFACE(getType, 2));
  il.append(new PUSH(cpg, DOM.ROOT));
 
  final BranchHandle skip = il.append(new IF_ICMPEQ(null));
  _falseList.add(il.append(new GOTO_W(null)));
  skip.setTarget(il.append(NOP));
View Full Code Here

            CHARACTERSW_SIG);

  // 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.
  il.append(classGen.loadTranslet());
View Full Code Here

  }
  else {
       il.append(methodGen.loadContextNode());
  }
  il.append(new INVOKEINTERFACE(uriIdx, 2));
  il.append(new PUSH(cpg, getStylesheet().getSystemId()));

  // Feck the rest of the parameters on the stack
  il.append(classGen.loadTranslet());
  il.append(DUP);
  il.append(new GETFIELD(domField));
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));
  }

  // 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

      _exp.translate(classGen, methodGen);
  }
  else if (isNodeValueTest() && (getParent() instanceof Step)) {
      _value.translate(classGen, methodGen);
      il.append(new CHECKCAST(cpg.addClass(STRING_CLASS)));
      il.append(new PUSH(cpg, ((EqualityExpr)_exp).getOp()));
  }
  else {
      translateFilter(classGen, methodGen);
  }
    }
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

TOP

Related Classes of org.apache.bcel.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.