当前位置: 首页>>代码示例>>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;未经允许,请勿转载。