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


Java ClassGenerator.getClassName方法代码示例

本文整理汇总了Java中com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator.getClassName方法的典型用法代码示例。如果您正苦于以下问题:Java ClassGenerator.getClassName方法的具体用法?Java ClassGenerator.getClassName怎么用?Java ClassGenerator.getClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator的用法示例。


在下文中一共展示了ClassGenerator.getClassName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compileDefault

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; //导入方法依赖的package包/类
/**
 * Compiles the predicate method
 */
private static void compileDefault(int defaultAction,
                                   ClassGenerator classGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = new InstructionList();
    final XSLTC xsltc = classGen.getParser().getXSLTC();

    // private boolean Translet.stripSpace(int type) - cannot be static
    final MethodGenerator stripSpace =
        new MethodGenerator(ACC_PUBLIC | ACC_FINAL ,
                    com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN,
                    new com.sun.org.apache.bcel.internal.generic.Type[] {
                        Util.getJCRefType(DOM_INTF_SIG),
                        com.sun.org.apache.bcel.internal.generic.Type.INT,
                        com.sun.org.apache.bcel.internal.generic.Type.INT
                    },
                    new String[] { "dom","node","type" },
                    "stripSpace",classGen.getClassName(),il,cpg);

    classGen.addInterface("com/sun/org/apache/xalan/internal/xsltc/StripFilter");

    if (defaultAction == STRIP_SPACE)
        il.append(ICONST_1);
    else
        il.append(ICONST_0);
    il.append(IRETURN);

    classGen.addMethod(stripSpace);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:Whitespace.java

示例2: translate

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

    // Fall-through for variables that are implemented as methods
    if (_type.implementedAsMethod()) return;

    final String name = _variable.getEscapedName();
    final String signature = _type.toSignature();

    if (_variable.isLocal()) {
        if (classGen.isExternal()) {
            Closure variableClosure = _closure;
            while (variableClosure != null) {
                if (variableClosure.inInnerClass()) break;
                variableClosure = variableClosure.getParentClosure();
            }

            if (variableClosure != null) {
                il.append(ALOAD_0);
                il.append(new GETFIELD(
                    cpg.addFieldref(variableClosure.getInnerClassName(),
                        name, signature)));
            }
            else {
                il.append(_variable.loadInstruction());
            }
        }
        else {
            il.append(_variable.loadInstruction());
        }
    }
    else {
        final String className = classGen.getClassName();
        il.append(classGen.loadTranslet());
        if (classGen.isExternal()) {
            il.append(new CHECKCAST(cpg.addClass(className)));
        }
        il.append(new GETFIELD(cpg.addFieldref(className,name,signature)));
    }

    if (_variable.getType() instanceof NodeSetType) {
        // The method cloneIterator() also does resetting
        final int clone = cpg.addInterfaceMethodref(NODE_ITERATOR,
                                                   "cloneIterator",
                                                   "()" +
                                                    NODE_ITERATOR_SIG);
        il.append(new INVOKEINTERFACE(clone, 1));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:51,代码来源:VariableRef.java

示例3: translate

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

    /*
     * To fix bug 24518 related to setting parameters of the form
     * {namespaceuri}localName, which will get mapped to an instance
     * variable in the class.
     */
    final String name = BasisLibrary.mapQNameToJavaName (_name.toString());
    final String signature = _type.toSignature();

    if (_variable.isLocal()) {
        if (classGen.isExternal()) {
            Closure variableClosure = _closure;
            while (variableClosure != null) {
                if (variableClosure.inInnerClass()) break;
                variableClosure = variableClosure.getParentClosure();
            }

            if (variableClosure != null) {
                il.append(ALOAD_0);
                il.append(new GETFIELD(
                    cpg.addFieldref(variableClosure.getInnerClassName(),
                        name, signature)));
            }
            else {
                il.append(_variable.loadInstruction());
            }
        }
        else {
            il.append(_variable.loadInstruction());
        }
    }
    else {
        final String className = classGen.getClassName();
        il.append(classGen.loadTranslet());
        if (classGen.isExternal()) {
            il.append(new CHECKCAST(cpg.addClass(className)));
        }
        il.append(new GETFIELD(cpg.addFieldref(className,name,signature)));
    }

    if (_variable.getType() instanceof NodeSetType) {
        // The method cloneIterator() also does resetting
        final int clone = cpg.addInterfaceMethodref(NODE_ITERATOR,
                                                   "cloneIterator",
                                                   "()" +
                                                    NODE_ITERATOR_SIG);
        il.append(new INVOKEINTERFACE(clone, 1));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:53,代码来源:ParameterRef.java

示例4: translate

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

    if (_disabled) return;
    // bug fix #4433133, add a call to named template from applyTemplates
    String className = classGen.getClassName();

    if (_compiled && isNamed()){
        String methodName = Util.escape(_name.toString());
        il.append(classGen.loadTranslet());
        il.append(methodGen.loadDOM());
        il.append(methodGen.loadIterator());
        il.append(methodGen.loadHandler());
        il.append(methodGen.loadCurrentNode());
        il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
                                                     methodName,
                                                     "("
                                                     + DOM_INTF_SIG
                                                     + NODE_ITERATOR_SIG
                                                     + TRANSLET_OUTPUT_SIG
                                                     + "I)V")));
        return;
    }

    if (_compiled) return;
    _compiled = true;

    // %OPT% Special handling for simple named templates.
    if (_isSimpleNamedTemplate && methodGen instanceof NamedMethodGenerator) {
        int numParams = _parameters.size();
        NamedMethodGenerator namedMethodGen = (NamedMethodGenerator)methodGen;

        // Update load/store instructions to access Params from the stack
        for (int i = 0; i < numParams; i++) {
            Param param = (Param)_parameters.elementAt(i);
            param.setLoadInstruction(namedMethodGen.loadParameter(i));
            param.setStoreInstruction(namedMethodGen.storeParameter(i));
        }
    }

    translateContents(classGen, methodGen);
    il.setPositions(true);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:Template.java


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