public MCpInfo newCpInfoClass(String className) { MCpInfo clazz = newCpInfo(CpClass); MCpInfo clazzName = newCpInfo(CpUtf8); clazz.ptr_name = clazzName; clazzName.str_bytes = className; return clazz; }
public MCpInfo newCpInfoUtf8(String str) { MCpInfo strUtf8 = cpUtf8Map.get(str); if (strUtf8 == null) { strUtf8 = newCpInfo(CpUtf8); strUtf8.str_bytes = str; cpUtf8Map.put(str, strUtf8); } return strUtf8; }
public MField newField(MCpInfo clazz, String name, String signature) { MField field = new MField(this); MCpInfo fieldName = newCpInfoUtf8(name); MCpInfo fieldSign = newCpInfoUtf8(signature); MCpInfo fieldNat = newCpInfo(CpNameAndType); MCpInfo fieldRef = newCpInfo(CpFieldref); field.ptr_name = fieldName; field.ptr_signature = fieldSign; field.ptr_ref = fieldRef; fieldNat.ptr_name = fieldName; fieldNat.ptr_signature = fieldSign; fieldRef.ptr_class = clazz; fieldRef.ptr_name_and_type = fieldNat; return field; }
public MMethod newMethod(MCpInfo clazz, String name, String signature) { MMethod method = new MMethod(this); MCpInfo methodName = newCpInfoUtf8(name); MCpInfo methodSign = newCpInfoUtf8(signature); MCpInfo methodNat = newCpInfo(CpNameAndType); MCpInfo methodRef = newCpInfo(CpMethodref); method.ptr_name = methodName; method.ptr_signature = methodSign; method.ptr_ref = methodRef; methodNat.ptr_name = methodName; methodNat.ptr_signature = methodSign; methodRef.ptr_class = clazz; methodRef.ptr_name_and_type = methodNat; return method; }
public MCpInfo newCpInfoString(String str) { MCpInfo cpStr = newCpInfo(CpString); cpStr.ptr_string = newCpInfoUtf8(str); return cpStr; }