當前位置: 首頁>>代碼示例>>Java>>正文


Java ClassEntry.getName方法代碼示例

本文整理匯總了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());
	}
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:8,代碼來源:ClassForest.java

示例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();
		}
	});
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:13,代碼來源:MappingsConverter.java

示例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;
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:14,代碼來源:ClassIdentifier.java

示例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());
	}
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:8,代碼來源:JarClassIterator.java

示例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);
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:10,代碼來源:ClassSelector.java

示例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;
}
 
開發者ID:cccssw,項目名稱:enigma-vk,代碼行數:53,代碼來源:MappingsConverter.java


注:本文中的cuchaz.enigma.mapping.ClassEntry.getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。