• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java INVOKESPECIAL类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL的典型用法代码示例。如果您正苦于以下问题:Java INVOKESPECIAL类的具体用法?Java INVOKESPECIAL怎么用?Java INVOKESPECIAL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



INVOKESPECIAL类属于com.sun.org.apache.bcel.internal.generic包,在下文中一共展示了INVOKESPECIAL类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: compileInit

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
/**
 * Create a constructor for the new class. Updates the reference to the
 * collator in the super calls only when the stylesheet specifies a new
 * language in xsl:sort.
 */
private static MethodGenerator compileInit(Vector sortObjects,
                                       NodeSortRecordGenerator sortRecord,
                                       ConstantPoolGen cpg,
                                       String className)
{
    final InstructionList il = new InstructionList();
    final MethodGenerator init =
        new MethodGenerator(ACC_PUBLIC,
                            com.sun.org.apache.bcel.internal.generic.Type.VOID,
                            null, null, "<init>", className,
                            il, cpg);

    // Call the constructor in the NodeSortRecord superclass
    il.append(ALOAD_0);
    il.append(new INVOKESPECIAL(cpg.addMethodref(NODE_SORT_RECORD,
                                                 "<init>", "()V")));



    il.append(RETURN);

    return init;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:Sort.java


示例2: compileInit

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
/**
 * Create a constructor for the new class. Updates the reference to the
 * collator in the super calls only when the stylesheet specifies a new
 * language in xsl:sort.
 */
private static MethodGenerator compileInit(NodeSortRecordGenerator sortRecord,
                                       ConstantPoolGen cpg,
                                       String className)
{
    final InstructionList il = new InstructionList();
    final MethodGenerator init =
        new MethodGenerator(ACC_PUBLIC,
                            com.sun.org.apache.bcel.internal.generic.Type.VOID,
                            null, null, "<init>", className,
                            il, cpg);

    // Call the constructor in the NodeSortRecord superclass
    il.append(ALOAD_0);
    il.append(new INVOKESPECIAL(cpg.addMethodref(NODE_SORT_RECORD,
                                                 "<init>", "()V")));



    il.append(RETURN);

    return init;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:Sort.java


示例3: translate

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    final int init = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      "<init>",
                                      "("+DOM_INTF_SIG+")V");
    final int iter = cpg.addMethodref(UNION_ITERATOR_CLASS,
                                      ADD_ITERATOR,
                                      ADD_ITERATOR_SIG);

    // Create the UnionIterator and leave it on the stack
    il.append(new NEW(cpg.addClass(UNION_ITERATOR_CLASS)));
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new INVOKESPECIAL(init));

    // Add the various iterators to the UnionIterator
    final int length = _components.length;
    for (int i = 0; i < length; i++) {
        _components[i].translate(classGen, methodGen);
        il.append(new INVOKEVIRTUAL(iter));
    }

    // Order the iterator only if strictly needed
    if (_reverse) {
        final int order = cpg.addInterfaceMethodref(DOM_INTF,
                                                    ORDER_ITERATOR,
                                                    ORDER_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(SWAP);
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(order, 3));

    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:UnionPathExpr.java


示例4: translate

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
/**
 * Generate a call to the method compiled for this attribute set
 */
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {

    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    final SymbolTable symbolTable = getParser().getSymbolTable();

    // Go through each attribute set and generate a method call
    for (int i=0; i<_sets.size(); i++) {
        // Get the attribute set name
        final QName name = (QName)_sets.elementAt(i);
        // Get the AttributeSet reference from the symbol table
        final AttributeSet attrs = symbolTable.lookupAttributeSet(name);
        // Compile the call to the set's method if the set exists
        if (attrs != null) {
            final String methodName = attrs.getMethodName();
            il.append(classGen.loadTranslet());
            il.append(methodGen.loadDOM());
            il.append(methodGen.loadIterator());
            il.append(methodGen.loadHandler());
            il.append(methodGen.loadCurrentNode());
            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();
            reportError(this, parser, ErrorMsg.ATTRIBSET_UNDEF_ERR, atrs);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:UseAttributeSets.java


示例5: translateTo

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
/**
 * Expects an integer on the stack and pushes a boxed integer.
 * Boxed integers are represented by an instance of
 * <code>java.lang.Integer</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
                                                 "<init>", "(I)V")));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:IntType.java


示例6: translateTo

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
/**
 * Expects a double on the stack and pushes a boxed double. Boxed
 * double are represented by an instance of <code>java.lang.Double</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(DOUBLE_CLASS)));
    il.append(DUP_X2);
    il.append(DUP_X2);
    il.append(POP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(DOUBLE_CLASS,
                                                 "<init>", "(D)V")));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:RealType.java


示例7: translateTo

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
/**
 * Expects a boolean on the stack and pushes a boxed boolean.
 * Boxed booleans are represented by an instance of
 * <code>java.lang.Boolean</code>.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        ReferenceType type) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
    il.append(DUP_X1);
    il.append(SWAP);
    il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                                                 "<init>",
                                                 "(Z)V")));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:BooleanType.java


示例8: translateTo

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
/**
 * Expects a node on the stack and pushes a singleton node-set. Singleton
 * iterators are already started after construction.
 *
 * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
 */
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                        NodeSetType type) {
    ConstantPoolGen cpg = classGen.getConstantPool();
    InstructionList il = methodGen.getInstructionList();

    // Create a new instance of SingletonIterator
    il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
    il.append(DUP_X1);
    il.append(SWAP);
    final int init = cpg.addMethodref(SINGLETON_ITERATOR, "<init>",
                                      "(" + NODE_SIG +")V");
    il.append(new INVOKESPECIAL(init));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:NodeType.java


示例9: compileConstructor

import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; //导入依赖的package包/类
/**
 * Compiles a constructor for the class <tt>_className</tt> that
 * inherits from {Any,Single,Multiple}NodeCounter. This constructor
 * simply calls the same constructor in the super class.
 */
private void compileConstructor(ClassGenerator classGen) {
    MethodGenerator cons;
    final InstructionList il = new InstructionList();
    final ConstantPoolGen cpg = classGen.getConstantPool();

    cons = new MethodGenerator(ACC_PUBLIC,
                               com.sun.org.apache.bcel.internal.generic.Type.VOID,
                               new com.sun.org.apache.bcel.internal.generic.Type[] {
                                   Util.getJCRefType(TRANSLET_INTF_SIG),
                                   Util.getJCRefType(DOM_INTF_SIG),
                                   Util.getJCRefType(NODE_ITERATOR_SIG),
                                   com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN
                               },
                               new String[] {
                                   "dom",
                                   "translet",
                                   "iterator",
                                   "hasFrom"
                               },
                               "<init>", _className, il, cpg);

    il.append(ALOAD_0);         // this
    il.append(ALOAD_1);         // translet
    il.append(ALOAD_2);         // DOM
    il.append(new ALOAD(3));    // iterator
    il.append(new ILOAD(4));    // hasFrom

    int index = cpg.addMethodref(ClassNames[_level],
                                 "<init>",
                                 "(" + TRANSLET_INTF_SIG
                                 + DOM_INTF_SIG
                                 + NODE_ITERATOR_SIG
                                 + "Z)V");
    il.append(new INVOKESPECIAL(index));
    il.append(RETURN);

    classGen.addMethod(cons);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:44,代码来源:Number.java



注:本文中的com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Button类代码示例发布时间:2022-05-23
下一篇:
Java FileInput类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap