当前位置: 首页>>代码示例>>Java>>正文


Java INVOKESPECIAL类代码示例

本文整理汇总了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;未经允许,请勿转载。