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

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

java 1次浏览

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

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

示例1: BaseLocalVariables

点赞 3

import com.android.dx.cf.code.LocalVariableList; //导入依赖的package包/类
/**
 * Constructs an instance.
 *
 * @param name {@code non-null;} attribute name
 * @param localVariables {@code non-null;} list of local variable entries
 */
public BaseLocalVariables(String name,
        LocalVariableList localVariables) {
    super(name);

    try {
        if (localVariables.isMutable()) {
            throw new MutabilityException("localVariables.isMutable()");
        }
    } catch (NullPointerException ex) {
        // Translate the exception.
        throw new NullPointerException("localVariables == null");
    }

    this.localVariables = localVariables;
}
 

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

示例2: localVariableTable

点赞 3

import com.android.dx.cf.code.LocalVariableList; //导入依赖的package包/类
/**
 * Parses a {@code LocalVariableTable} attribute.
 */
private Attribute localVariableTable(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_table_length: " + Hex.u2(count));
    }

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

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

示例3: localVariableTypeTable

点赞 3

import com.android.dx.cf.code.LocalVariableList; //导入依赖的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

示例4: parseLocalVariables

点赞 2

import com.android.dx.cf.code.LocalVariableList; //导入依赖的package包/类
/**
 * Parse the table part of either a {@code LocalVariableTable}
 * or a {@code LocalVariableTypeTable}.
 *
 * @param bytes {@code non-null;} bytes to parse, which should <i>only</i>
 * contain the table data (no header)
 * @param pool {@code non-null;} constant pool to use
 * @param count {@code >= 0;} the number of entries
 * @param typeTable {@code true} iff this is for a type table
 * @return {@code non-null;} the constructed list
 */
private LocalVariableList parseLocalVariables(ByteArray bytes,
        ConstantPool pool, ParseObserver observer, int count,
        boolean typeTable) {
    if (bytes.size() != (count * 10)) {
        // "+ 2" is for the count.
        throwBadLength((count * 10) + 2);
    }

    ByteArray.MyDataInputStream in = bytes.makeDataInputStream();
    LocalVariableList list = new LocalVariableList(count);

    try {
        for (int i = 0; i < count; i++) {
            int startPc = in.readUnsignedShort();
            int length = in.readUnsignedShort();
            int nameIdx = in.readUnsignedShort();
            int typeIdx = in.readUnsignedShort();
            int index = in.readUnsignedShort();
            CstString name = (CstString) pool.get(nameIdx);
            CstString type = (CstString) pool.get(typeIdx);
            CstString descriptor = null;
            CstString signature = null;

            if (typeTable) {
                signature = type;
            } else {
                descriptor = type;
            }

            list.set(i, startPc, length, name,
                    descriptor, signature, index);

            if (observer != null) {
                observer.parsed(bytes, i * 10, 10, Hex.u2(startPc) +
                        ".." + Hex.u2(startPc + length) + " " +
                        Hex.u2(index) + " " + name.toHuman() + " " +
                        type.toHuman());
            }
        }
    } catch (IOException ex) {
        throw new RuntimeException("shouldn't happen", ex);
    }

    list.setImmutable();
    return list;
}
 

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

示例5: AttLocalVariableTypeTable

点赞 1

import com.android.dx.cf.code.LocalVariableList; //导入依赖的package包/类
/**
 * Constructs an instance.
 *
 * @param localVariables {@code non-null;} list of local variable entries
 */
public AttLocalVariableTypeTable(LocalVariableList localVariables) {
    super(ATTRIBUTE_NAME, localVariables);
}
 

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

示例6: getLocalVariables

点赞 1

import com.android.dx.cf.code.LocalVariableList; //导入依赖的package包/类
/**
 * Gets the list of "local variable" entries associated with this instance.
 *
 * @return {@code non-null;} the list
 */
public final LocalVariableList getLocalVariables() {
    return localVariables;
}
 

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

示例7: AttLocalVariableTable

点赞 1

import com.android.dx.cf.code.LocalVariableList; //导入依赖的package包/类
/**
 * Constructs an instance.
 *
 * @param localVariables {@code non-null;} list of local variable entries
 */
public AttLocalVariableTable(LocalVariableList localVariables) {
    super(ATTRIBUTE_NAME, localVariables);
}
 

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


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