本文整理匯總了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;
}