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


Java Field.getName方法代码示例

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


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

示例1: reField

import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
@Override
protected Field reField(Field field) {
    String name = field.getName();
    String newType;
    boolean isBasic = false;
    boolean isArray = false;
    if (field.getType().startsWith("[")) {
        isArray = true;
    }
    if (basicType.containsKey(field.getType())) {
        newType = field.getType();
        isBasic = true;
    } else {

        newType = DefineUtils.getDalvikClassName(field.getType());
    }
    String defineClass = DefineUtils.getDalvikClassName(field.getDefiningClass());
    return new ImmutableField(
            reType,
            classProcessor.filedProcess(defineClass, isBasic ? basicType.get(newType) : newType + (isArray ? "[]" : ""), name).fieldName,
            isBasic ? newType :
                    DefineUtils.getDefineClassName(classProcessor.classProcess(isBasic ? basicType.get(newType) : newType).className, isArray),
            field.getAccessFlags(),
            field.getInitialValue(),
            getAnnotation(field.getAnnotations()));
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:27,代码来源:ClassReIClassDef.java

示例2: onSimpleEdit

import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
@Override
protected Field onSimpleEdit(Field patch, PatcherAnnotation annotation, Field target, boolean inPlace) {

	// Use the static field initializer value in source only
	// if not renaming, given that the static constructor in
	// source would only initialize it if not renamed.
	// This makes behavior predictable across compilers.
	EncodedValue value = inPlace ? target.getInitialValue() : null;
	value = filterInitialValue(patch, value);

	onSimpleRemove(patch, annotation, target);

	Field patched = new BasicField(
			patch.getDefiningClass(),
			patch.getName(),
			patch.getType(),
			patch.getAccessFlags(),
			value,
			annotation.getFilteredAnnotations());

	return super.onSimpleEdit(patched, annotation, target, inPlace);

}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:24,代码来源:FieldSetPatcher.java

示例3: getDeclaredFields

import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
@Override
public FieldInfo[] getDeclaredFields() {
    List<FieldInfo> result = new ArrayList<>();
    Iterable<? extends Field> implFields = classDef.getFields();

    for (Field field : implFields) {
        FieldInfo fi = new FieldInfo();
        fi.typeName = DexlibAdapter.getTypeName(field.getType());
        fi.modifiers = field.getAccessFlags();
        fi.annotations = convertAnnotations(field.getAnnotations());
        fi.name = field.getName();

        result.add(fi);
    }

    FieldInfo[] array = new FieldInfo[result.size()];
    return result.toArray(array);
}
 
开发者ID:google,项目名称:android-classyshark,代码行数:19,代码来源:MetaObjectDex.java

示例4: of

import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
public static ImmutableField of(Field field) {
    if (field instanceof  ImmutableField) {
        return (ImmutableField)field;
    }
    return new ImmutableField(
            field.getDefiningClass(),
            field.getName(),
            field.getType(),
            field.getAccessFlags(),
            field.getInitialValue(),
            field.getAnnotations());
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:13,代码来源:ImmutableField.java

示例5: makeSootField

import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
/**
 *
 * @return the Soot equivalent of a field
 */
public static SootField makeSootField(Field f) {
    String name = f.getName();
    Type type = DexType.toSoot(f.getType());
    int flags = f.getAccessFlags();
    SootField sf = new SootField(name, type, flags);
    if (Modifier.isFinal(flags))
        DexField.addConstantTag(sf, f);
    return sf;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:14,代码来源:DexField.java

示例6: onSimpleAdd

import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
@Override
protected Field onSimpleAdd(Field patch, PatcherAnnotation annotation) {

	EncodedValue value = filterInitialValue(patch, null);

	return new BasicField(
			patch.getDefiningClass(),
			patch.getName(),
			patch.getType(),
			patch.getAccessFlags(),
			value,
			annotation.getFilteredAnnotations());

}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:15,代码来源:FieldSetPatcher.java

示例7: of

import org.jf.dexlib2.iface.Field; //导入方法依赖的package包/类
public static ImmutableField of(Field field) {
    if (field instanceof ImmutableField) {
        return (ImmutableField) field;
    }
    return new ImmutableField(
            field.getDefiningClass(),
            field.getName(),
            field.getType(),
            field.getAccessFlags(),
            field.getInitialValue(),
            field.getAnnotations());
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:13,代码来源:ImmutableField.java


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