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


Java TypeLibrary類代碼示例

本文整理匯總了Java中lombok.core.TypeLibrary的典型用法代碼示例。如果您正苦於以下問題:Java TypeLibrary類的具體用法?Java TypeLibrary怎麽用?Java TypeLibrary使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TypeLibrary類屬於lombok.core包,在下文中一共展示了TypeLibrary類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadAll

import lombok.core.TypeLibrary; //導入依賴的package包/類
private static void loadAll(TypeLibrary library, Map<String, EclipseSingularizer> map) throws IOException {
	for (EclipseSingularizer handler : SpiLoadUtil.findServices(EclipseSingularizer.class, EclipseSingularizer.class.getClassLoader())) {
		for (String type : handler.getSupportedTypes()) {
			EclipseSingularizer existingSingularizer = map.get(type);
			if (existingSingularizer != null) {
				EclipseSingularizer toKeep = existingSingularizer.getClass().getName().compareTo(handler.getClass().getName()) > 0 ? handler : existingSingularizer;
				System.err.println("Multiple singularizers found for type " + type + "; the alphabetically first class is used: " + toKeep.getClass().getName());
				map.put(type, toKeep);
			} else {
				map.put(type, handler);
				library.addType(type);
			}
		}
	}
}
 
開發者ID:git03394538,項目名稱:lombok-ianchiu,代碼行數:16,代碼來源:EclipseSingularsRecipes.java

示例2: loadAll

import lombok.core.TypeLibrary; //導入依賴的package包/類
private static void loadAll(TypeLibrary library, Map<String, JavacSingularizer> map) throws IOException {
	for (JavacSingularizer handler : SpiLoadUtil.findServices(JavacSingularizer.class, JavacSingularizer.class.getClassLoader())) {
		for (String type : handler.getSupportedTypes()) {
			JavacSingularizer existingSingularizer = map.get(type);
			if (existingSingularizer != null) {
				JavacSingularizer toKeep = existingSingularizer.getClass().getName().compareTo(handler.getClass().getName()) > 0 ? handler : existingSingularizer;
				System.err.println("Multiple singularizers found for type " + type + "; the alphabetically first class is used: " + toKeep.getClass().getName());
				map.put(type, toKeep);
			} else {
				map.put(type, handler);
				library.addType(type);
			}
		}
	}
}
 
開發者ID:git03394538,項目名稱:lombok-ianchiu,代碼行數:16,代碼來源:JavacSingularsRecipes.java


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