本文整理了Java中com.squareup.javapoet.ClassName.getPackage()
方法的一些代码示例,展示了ClassName.getPackage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ClassName.getPackage()
方法的具体详情如下:
包路径:com.squareup.javapoet.ClassName
类名称:ClassName
方法名:getPackage
暂无
代码示例来源:origin: io.virtdata/virtdata-lib-realer
/** Returns the class name for {@code element}. */
public static ClassName get(TypeElement element) {
checkNotNull(element, "element == null");
List<String> names = new ArrayList<>();
for (Element e = element; isClassOrInterface(e); e = e.getEnclosingElement()) {
checkArgument(element.getNestingKind() == TOP_LEVEL || element.getNestingKind() == MEMBER,
"unexpected type testing");
names.add(e.getSimpleName().toString());
}
names.add(getPackage(element).getQualifiedName().toString());
Collections.reverse(names);
return new ClassName(names);
}
代码示例来源:origin: xiaoxiangyeyuHeaven/JD-shopping-mall
/** Returns the class name for {@code element}. */
public static ClassName get(TypeElement element) {
checkNotNull(element, "element == null");
List<String> names = new ArrayList<>();
for (Element e = element; isClassOrInterface(e); e = e.getEnclosingElement()) {
checkArgument(element.getNestingKind() == TOP_LEVEL || element.getNestingKind() == MEMBER,
"unexpected type testing");
names.add(e.getSimpleName().toString());
}
names.add(getPackage(element).getQualifiedName().toString());
Collections.reverse(names);
return new ClassName(names);
}
内容来源于网络,如有侵权,请联系作者删除!