• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FieldList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addDependencies

import com.android.dx.cf.iface.FieldList; //导入依赖的package包/类
private void addDependencies(DirectClassFile classFile) {
    for (Constant constant : classFile.getConstantPool().getEntries()) {
        if (constant instanceof CstType) {
            checkDescriptor(((CstType) constant).getClassType().getDescriptor());
        } else if (constant instanceof CstFieldRef) {
            checkDescriptor(((CstFieldRef) constant).getType().getDescriptor());
        } else if (constant instanceof CstBaseMethodRef) {
            checkPrototype(((CstBaseMethodRef) constant).getPrototype());
        }
    }
    FieldList fields = classFile.getFields();
    int nbField = fields.size();
    for (int i = 0; i < nbField; i++) {
      checkDescriptor(fields.get(i).getDescriptor().getString());
    }
    MethodList methods = classFile.getMethods();
    int nbMethods = methods.size();
    for (int i = 0; i < nbMethods; i++) {
      checkPrototype(Prototype.intern(methods.get(i).getDescriptor().getString()));
    }
}
 
开发者ID:dodola,项目名称:RocooFix,代码行数:22,代码来源:ClassReferenceListBuilder.java


示例2: addDependencies

import com.android.dx.cf.iface.FieldList; //导入依赖的package包/类
private void addDependencies(DirectClassFile classFile) {
    for (Constant constant : classFile.getConstantPool().getEntries()) {
        if (constant instanceof CstType) {
            checkDescriptor(((CstType) constant).getClassType().getDescriptor());
        } else if (constant instanceof CstFieldRef) {
            checkDescriptor(((CstFieldRef) constant).getType().getDescriptor());
        } else if (constant instanceof CstBaseMethodRef) {
            checkPrototype(((CstBaseMethodRef) constant).getPrototype());
        }
    }

    FieldList fields = classFile.getFields();
    int nbField = fields.size();
    for (int i = 0; i < nbField; i++) {
      checkDescriptor(fields.get(i).getDescriptor().getString());
    }

    MethodList methods = classFile.getMethods();
    int nbMethods = methods.size();
    for (int i = 0; i < nbMethods; i++) {
      checkPrototype(Prototype.intern(methods.get(i).getDescriptor().getString()));
    }
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:24,代码来源:ClassReferenceListBuilder.java


示例3: keepAnnotated

import com.android.dx.cf.iface.FieldList; //导入依赖的package包/类
/**
 * Keep classes annotated with runtime annotations.
 */
private void keepAnnotated(Path path) throws FileNotFoundException {
    for (ClassPathElement element : path.getElements()) {
        forClazz:
            for (String name : element.list()) {
                if (name.endsWith(CLASS_EXTENSION)) {
                    DirectClassFile clazz = path.getClass(name);
                    if (hasRuntimeVisibleAnnotation(clazz)) {
                        filesToKeep.add(name);
                    } else {
                        MethodList methods = clazz.getMethods();
                        for (int i = 0; i<methods.size(); i++) {
                            if (hasRuntimeVisibleAnnotation(methods.get(i))) {
                                filesToKeep.add(name);
                                continue forClazz;
                            }
                        }
                        FieldList fields = clazz.getFields();
                        for (int i = 0; i<fields.size(); i++) {
                            if (hasRuntimeVisibleAnnotation(fields.get(i))) {
                                filesToKeep.add(name);
                                continue forClazz;
                            }
                        }
                    }
                }
            }
    }
}
 
开发者ID:dodola,项目名称:RocooFix,代码行数:32,代码来源:MainDexListBuilder.java


示例4: getFields

import com.android.dx.cf.iface.FieldList; //导入依赖的package包/类
/** {@inheritDoc} */
public FieldList getFields() {
    parseToEndIfNecessary();
    return fields;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:6,代码来源:DirectClassFile.java


示例5: processFields

import com.android.dx.cf.iface.FieldList; //导入依赖的package包/类
/**
 * Processes the fields and adds corresponding elements to the class
 * element.
 * 
 * @param skeletonOnly
 */
private void processFields(FieldList fieldList, Element classElement,
        Map<String, ReferenceKind> referencedTypes, boolean skeletonOnly) {
    for (int i = 0; i < fieldList.size(); ++i) {
        Field field = fieldList.get(i);
        if (hasIgnoreAnnotation(field.getAttributes())) {
            // If this field has the @XMLVMIgnore annotation, we just
            // simply ignore it.
            continue;
        }
        if (skeletonOnly
                && (field.getAccessFlags() & (AccessFlags.ACC_PRIVATE | AccessFlags.ACC_SYNTHETIC)) != 0) {
            // This field is private or synthetic and we want to generate
            // only a skeleton, so we just simply ignore it.
            continue;
        }
        Element fieldElement = new Element("field", NS_XMLVM);
        fieldElement.setAttribute("name", field.getName().toHuman());
        String fieldType = field.getNat().getFieldType().toHuman();
        if (isRedType(fieldType)) {
            fieldType = JLO;
        } else {
            addReference(referencedTypes, fieldType, ReferenceKind.USAGE);
        }

        fieldElement.setAttribute("type", fieldType);
        TypedConstant value = field.getConstantValue();
        if (value != null) {
            String constValue = null;
            if (fieldType.equals("java.lang.String")) {
                constValue = ((CstString) value).getString().getString();
                encodeString(fieldElement, constValue);
            } else {
                constValue = value.toHuman();
                fieldElement.setAttribute("value", constValue);
            }
        }
        processAccessFlags(field.getAccessFlags(), fieldElement);
        classElement.addContent(fieldElement);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:47,代码来源:DEXmlvmOutputProcess.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Func7类代码示例发布时间:2022-05-23
下一篇:
Java PGPObjectFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap