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


Java Utility.methodSignatureArgumentTypes方法代码示例

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


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

示例1: visitMethod

import org.apache.bcel.classfile.Utility; //导入方法依赖的package包/类
/**
 * @see org.apache.bcel.classfile.Visitor#visitMethod(org.apache.bcel.classfile.Method)
 */
public void visitMethod(Method m) {
	log("      method=" + m.getName(), Project.MSG_VERBOSE);
	String retType = Utility.methodSignatureReturnType(m.getSignature());
	log("         method ret type=" + retType, Project.MSG_VERBOSE);
	if (!"void".equals(retType))
		design.checkClass(retType);

	String[] types = Utility.methodSignatureArgumentTypes(m.getSignature());
	for (int i = 0; i < types.length; i++) {
		log("         method param[" + i + "]=" + types[i], Project.MSG_VERBOSE);
		design.checkClass(types[i]);
	}

	ExceptionTable excs = m.getExceptionTable();
	if (excs != null) {
		types = excs.getExceptionNames();
		for (int i = 0; i < types.length; i++) {
			log("         exc=" + types[i], Project.MSG_VERBOSE);
			design.checkClass(types[i]);
		}
	}

	processInstructions(m);
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:28,代码来源:VisitorImpl.java

示例2: parseSignature

import org.apache.bcel.classfile.Utility; //导入方法依赖的package包/类
private Element parseSignature(String signature) {
    org.jdom.Element sgn = new Element("signature", nsXMLVM);
    String[] params = Utility.methodSignatureArgumentTypes(signature, false);

    Element ret = new Element("return", nsXMLVM);
    ret.setAttribute("type", Utility.methodSignatureReturnType(signature, false));
    sgn.addContent(ret);

    for (int i = 0; i < params.length; i++) {
        Element param = new Element("parameter", nsXMLVM);
        param.setAttribute("type", params[i]);
        sgn.addContent(param);
    }
    return sgn;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:ClassToXmlvmProcess.java

示例3: writeMethod

import org.apache.bcel.classfile.Utility; //导入方法依赖的package包/类
private final void writeMethod( Method method, int method_number ) throws IOException {
    // Get raw signature
    String signature = method.getSignature();
    // Get array of strings containing the argument types 
    String[] args = Utility.methodSignatureArgumentTypes(signature, false);
    // Get return type string
    String type = Utility.methodSignatureReturnType(signature, false);
    // Get method name
    String name = method.getName(), html_name;
    // Get method's access flags
    String access = Utility.accessToString(method.getAccessFlags());
    // Get the method's attributes, the Code Attribute in particular
    Attribute[] attributes = method.getAttributes();
    /* HTML doesn't like names like <clinit> and spaces are places to break
     * lines. Both we don't want...
     */
    access = Utility.replace(access, " ", "&nbsp;");
    html_name = Class2HTML.toHTML(name);
    file.print("<TR VALIGN=TOP><TD><FONT COLOR=\"#FF0000\"><A NAME=method" + method_number
            + ">" + access + "</A></FONT></TD>");
    file.print("<TD>" + Class2HTML.referenceType(type) + "</TD><TD>" + "<A HREF=" + class_name
            + "_code.html#method" + method_number + " TARGET=Code>" + html_name
            + "</A></TD>\n<TD>(");
    for (int i = 0; i < args.length; i++) {
        file.print(Class2HTML.referenceType(args[i]));
        if (i < args.length - 1) {
            file.print(", ");
        }
    }
    file.print(")</TD></TR>");
    // Check for thrown exceptions
    for (int i = 0; i < attributes.length; i++) {
        attribute_html.writeAttribute(attributes[i], "method" + method_number + "@" + i,
                method_number);
        byte tag = attributes[i].getTag();
        if (tag == ATTR_EXCEPTIONS) {
            file.print("<TR VALIGN=TOP><TD COLSPAN=2></TD><TH ALIGN=LEFT>throws</TH><TD>");
            int[] exceptions = ((ExceptionTable) attributes[i]).getExceptionIndexTable();
            for (int j = 0; j < exceptions.length; j++) {
                file.print(constant_html.referenceConstant(exceptions[j]));
                if (j < exceptions.length - 1) {
                    file.print(", ");
                }
            }
            file.println("</TD></TR>");
        } else if (tag == ATTR_CODE) {
            Attribute[] c_a = ((Code) attributes[i]).getAttributes();
            for (int j = 0; j < c_a.length; j++) {
                attribute_html.writeAttribute(c_a[j], "method" + method_number + "@" + i + "@"
                        + j, method_number);
            }
        }
    }
}
 
开发者ID:Hu6,项目名称:VestaClient,代码行数:55,代码来源:MethodHTML.java


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