Search in sources :

Example 1 with JsonFieldMapping

use of jadx.core.codegen.json.mapping.JsonFieldMapping in project jadx by skylot.

the class JsonMappingGen method addFields.

private static void addFields(ClassNode cls, JsonClsMapping jsonCls) {
    List<FieldNode> fields = cls.getFields();
    if (fields.isEmpty()) {
        return;
    }
    jsonCls.setFields(new ArrayList<>(fields.size()));
    for (FieldNode field : fields) {
        JsonFieldMapping jsonField = new JsonFieldMapping();
        jsonField.setName(field.getName());
        jsonField.setAlias(field.getAlias());
        jsonCls.getFields().add(jsonField);
    }
}
Also used : FieldNode(jadx.core.dex.nodes.FieldNode) JsonFieldMapping(jadx.core.codegen.json.mapping.JsonFieldMapping)

Aggregations

JsonFieldMapping (jadx.core.codegen.json.mapping.JsonFieldMapping)1 FieldNode (jadx.core.dex.nodes.FieldNode)1