• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AttLocalVariableTypeTable类的典型用法和代码示例

java 4次浏览

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

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

示例1: localVariableTypeTable

点赞 3

import com.android.dx.cf.attrib.AttLocalVariableTypeTable; //导入依赖的package包/类
/**
 * Parses a {@code LocalVariableTypeTable} attribute.
 */
private Attribute localVariableTypeTable(DirectClassFile cf, int offset,
        int length, ParseObserver observer) {
    if (length < 2) {
        return throwSeverelyTruncated();
    }

    ByteArray bytes = cf.getBytes();
    int count = bytes.getUnsignedShort(offset);

    if (observer != null) {
        observer.parsed(bytes, offset, 2,
                "local_variable_type_table_length: " + Hex.u2(count));
    }

    LocalVariableList list = parseLocalVariables(
            bytes.slice(offset + 2, offset + length), cf.getConstantPool(),
            observer, count, true);
    return new AttLocalVariableTypeTable(list);
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:23,
代码来源:StdAttributeFactory.java

示例2: ConcreteMethod

点赞 2

import com.android.dx.cf.attrib.AttLocalVariableTypeTable; //导入依赖的package包/类
public ConcreteMethod(Method method, int accessFlags, CstString sourceFile,
        boolean keepLines, boolean keepLocals) {
    this.method = method;
    this.accSuper = (accessFlags & AccessFlags.ACC_SUPER) != 0;
    this.sourceFile = sourceFile;

    AttributeList attribs = method.getAttributes();
    this.attCode = (AttCode) attribs.findFirst(AttCode.ATTRIBUTE_NAME);

    AttributeList codeAttribs = attCode.getAttributes();

    /*
     * Combine all LineNumberTable attributes into one, with the
     * combined result saved into the instance. The following code
     * isn't particularly efficient for doing merges, but as far
     * as I know, this situation rarely occurs "in the
     * wild," so there's not much point in optimizing for it.
     */
    LineNumberList lineNumbers = LineNumberList.EMPTY;
    if (keepLines) {
        for (AttLineNumberTable lnt = (AttLineNumberTable)
                 codeAttribs.findFirst(AttLineNumberTable.ATTRIBUTE_NAME);
             lnt != null;
             lnt = (AttLineNumberTable) codeAttribs.findNext(lnt)) {
            lineNumbers = LineNumberList.concat(lineNumbers,
                    lnt.getLineNumbers());
        }
    }
    this.lineNumbers = lineNumbers;

    LocalVariableList localVariables = LocalVariableList.EMPTY;
    if (keepLocals) {
        /*
         * Do likewise (and with the same caveat) for
         * LocalVariableTable and LocalVariableTypeTable attributes.
         * This combines both of these kinds of attribute into a
         * single LocalVariableList.
         */
        for (AttLocalVariableTable lvt = (AttLocalVariableTable)
                 codeAttribs.findFirst(
                         AttLocalVariableTable.ATTRIBUTE_NAME);
             lvt != null;
             lvt = (AttLocalVariableTable) codeAttribs.findNext(lvt)) {
            localVariables =
                LocalVariableList.concat(localVariables,
                        lvt.getLocalVariables());
        }

        LocalVariableList typeList = LocalVariableList.EMPTY;
        for (AttLocalVariableTypeTable lvtt = (AttLocalVariableTypeTable)
                 codeAttribs.findFirst(
                         AttLocalVariableTypeTable.ATTRIBUTE_NAME);
             lvtt != null;
             lvtt =
                 (AttLocalVariableTypeTable) codeAttribs.findNext(lvtt)) {
            typeList =
                LocalVariableList.concat(typeList,
                        lvtt.getLocalVariables());
        }

        if (typeList.size() != 0) {
            localVariables =
                LocalVariableList.mergeDescriptorsAndSignatures(
                        localVariables, typeList);
        }
    }
    this.localVariables = localVariables;
}
 

开发者ID:JLLK,
项目名称:multidex-maker,
代码行数:69,
代码来源:ConcreteMethod.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)