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


Java NameValuePair.getValue方法代码示例

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


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

示例1: annotateTo

import com.android.dx.rop.annotation.NameValuePair; //导入方法依赖的package包/类
/**
 * Write a (listing file) annotation for this instance to the given
 * output, that consumes no bytes of output. This is for annotating
 * a reference to this instance at the point of the reference.
 *
 * @param out {@code non-null;} where to output to
 * @param prefix {@code non-null;} prefix for each line of output
 */
public void annotateTo(AnnotatedOutput out, String prefix) {
    out.annotate(0, prefix + "visibility: " +
            annotation.getVisibility().toHuman());
    out.annotate(0, prefix + "type: " + annotation.getType().toHuman());

    for (NameValuePair pair : annotation.getNameValuePairs()) {
        CstString name = pair.getName();
        Constant value = pair.getValue();

        out.annotate(0, prefix + name.toHuman() + ": " +
                ValueEncoder.constantToHuman(value));
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:22,代码来源:AnnotationItem.java

示例2: writeAnnotation

import com.android.dx.rop.annotation.NameValuePair; //导入方法依赖的package包/类
/**
 * Writes out the encoded form of the given annotation, that is,
 * as an {@code encoded_annotation} and not including a
 * {@code value_type} prefix. If the output stream keeps
 * (debugging) annotations and {@code topLevel} is
 * {@code true}, then this method will write (debugging)
 * annotations.
 *
 * @param annotation {@code non-null;} annotation instance to write
 * @param topLevel {@code true} iff the given annotation is the
 * top-level annotation or {@code false} if it is a sub-annotation
 * of some other annotation
 */
public void writeAnnotation(Annotation annotation, boolean topLevel) {
    boolean annotates = topLevel && out.annotates();
    StringIdsSection stringIds = file.getStringIds();
    TypeIdsSection typeIds = file.getTypeIds();

    CstType type = annotation.getType();
    int typeIdx = typeIds.indexOf(type);

    if (annotates) {
        out.annotate("  type_idx: " + Hex.u4(typeIdx) + " // " +
                type.toHuman());
    }

    out.writeUleb128(typeIds.indexOf(annotation.getType()));

    Collection<NameValuePair> pairs = annotation.getNameValuePairs();
    int size = pairs.size();

    if (annotates) {
        out.annotate("  size: " + Hex.u4(size));
    }

    out.writeUleb128(size);

    int at = 0;
    for (NameValuePair pair : pairs) {
        CstString name = pair.getName();
        int nameIdx = stringIds.indexOf(name);
        Constant value = pair.getValue();

        if (annotates) {
            out.annotate(0, "  elements[" + at + "]:");
            at++;
            out.annotate("    name_idx: " + Hex.u4(nameIdx) + " // " +
                    name.toHuman());
        }

        out.writeUleb128(nameIdx);

        if (annotates) {
            out.annotate("    value: " + constantToHuman(value));
        }

        writeConstant(value);
    }

    if (annotates) {
        out.endAnnotation();
    }
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:64,代码来源:ValueEncoder.java


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