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