本文整理汇总了Java中cuchaz.enigma.mapping.ClassEntry.getName方法的典型用法代码示例。如果您正苦于以下问题:Java ClassEntry.getName方法的具体用法?Java ClassEntry.getName怎么用?Java ClassEntry.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cuchaz.enigma.mapping.ClassEntry
的用法示例。
在下文中一共展示了ClassEntry.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import cuchaz.enigma.mapping.ClassEntry; //导入方法依赖的package包/类
public void add(ClassEntry entry) {
try {
m_forest.put(m_identifier.identify(entry), entry);
} catch (ClassNotFoundException ex) {
throw new Error("Unable to find class " + entry.getName());
}
}
示例2: translate
import cuchaz.enigma.mapping.ClassEntry; //导入方法依赖的package包/类
private static Type translate(Type type, final BiMap<ClassEntry,ClassEntry> map) {
return new Type(type, new ClassNameReplacer() {
@Override
public String replace(String inClassName) {
ClassEntry outClassEntry = map.get(new ClassEntry(inClassName));
if (outClassEntry == null) {
return null;
}
return outClassEntry.getName();
}
});
}
示例3: identify
import cuchaz.enigma.mapping.ClassEntry; //导入方法依赖的package包/类
public ClassIdentity identify(ClassEntry classEntry)
throws ClassNotFoundException {
ClassIdentity identity = m_cache.get(classEntry);
if (identity == null) {
CtClass c = m_loader.loadClass(classEntry.getName());
if (c == null) {
throw new ClassNotFoundException(classEntry.getName());
}
identity = new ClassIdentity(c, m_namer, m_index, m_useReferences);
m_cache.put(classEntry, identity);
}
return identity;
}
示例4: getClass
import cuchaz.enigma.mapping.ClassEntry; //导入方法依赖的package包/类
public static CtClass getClass(JarFile jar, ClassEntry classEntry) {
try {
return getClass(jar, new JarEntry(classEntry.getName() + ".class"));
} catch (IOException | NotFoundException ex) {
throw new Error("Unable to load class: " + classEntry.getName());
}
}
示例5: compare
import cuchaz.enigma.mapping.ClassEntry; //导入方法依赖的package包/类
@Override
public int compare(ClassEntry a, ClassEntry b) {
String aname = a.getName();
String bname = a.getName();
if (aname.length() != bname.length()) {
return aname.length() - bname.length();
}
return aname.compareTo(bname);
}
示例6: migrateClassMapping
import cuchaz.enigma.mapping.ClassEntry; //导入方法依赖的package包/类
private static ClassMapping migrateClassMapping(ClassEntry newObfClass, ClassMapping oldClassMapping, final ClassMatches matches, boolean useSimpleName) {
ClassNameReplacer replacer = new ClassNameReplacer() {
@Override
public String replace(String className) {
ClassEntry newClassEntry = matches.getUniqueMatches().get(new ClassEntry(className));
if (newClassEntry != null) {
return newClassEntry.getName();
}
return null;
}
};
ClassMapping newClassMapping;
String deobfName = oldClassMapping.getDeobfName();
if (deobfName != null) {
if (useSimpleName) {
deobfName = new ClassEntry(deobfName).getSimpleName();
}
newClassMapping = new ClassMapping(newObfClass.getName(), deobfName);
} else {
newClassMapping = new ClassMapping(newObfClass.getName());
}
// migrate fields
for (FieldMapping oldFieldMapping : oldClassMapping.fields()) {
if (canMigrate(oldFieldMapping.getObfType(), matches)) {
newClassMapping.addFieldMapping(new FieldMapping(oldFieldMapping, replacer));
} else {
System.out.println(String.format("Can't map field, dropping: %s.%s %s",
oldClassMapping.getDeobfName(),
oldFieldMapping.getDeobfName(),
oldFieldMapping.getObfType()
));
}
}
// migrate methods
for (MethodMapping oldMethodMapping : oldClassMapping.methods()) {
if (canMigrate(oldMethodMapping.getObfSignature(), matches)) {
newClassMapping.addMethodMapping(new MethodMapping(oldMethodMapping, replacer));
} else {
System.out.println(String.format("Can't map method, dropping: %s.%s %s",
oldClassMapping.getDeobfName(),
oldMethodMapping.getDeobfName(),
oldMethodMapping.getObfSignature()
));
}
}
return newClassMapping;
}