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


Java FieldList.size方法代码示例

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


在下文中一共展示了FieldList.size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。