本文整理汇总了Java中com.squareup.javapoet.ClassName.packageName方法的典型用法代码示例。如果您正苦于以下问题:Java ClassName.packageName方法的具体用法?Java ClassName.packageName怎么用?Java ClassName.packageName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.squareup.javapoet.ClassName
的用法示例。
在下文中一共展示了ClassName.packageName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInjectedFQCN
import com.squareup.javapoet.ClassName; //导入方法依赖的package包/类
public static String getInjectedFQCN(ClassName className) {
StringBuilder name = new StringBuilder();
for (String part : className.simpleNames()) {
if (name.length() > 0) {
name.append("$");
}
name.append(part);
}
return className.packageName() + "." + name.toString() + Constants.MAPPER_CLASS_SUFFIX;
}
示例2: toOutputClass
import com.squareup.javapoet.ClassName; //导入方法依赖的package包/类
public static ClassName toOutputClass(TypeName dataEnumType) throws ParserException {
ClassName dataEnumClass = (ClassName) dataEnumType;
String packageName = dataEnumClass.packageName();
String name = dataEnumClass.simpleName();
if (!name.endsWith(SUFFIX)) {
throw new ParserException(
String.format(
"Bad name for DataEnum interface! Name must end with '%s', found: %s", SUFFIX, name));
}
String nameWithoutSuffix = name.substring(0, name.length() - SUFFIX.length());
return ClassName.get(packageName, nameWithoutSuffix);
}
示例3: findDaggerComponent
import com.squareup.javapoet.ClassName; //导入方法依赖的package包/类
private ClassName findDaggerComponent(TypeMirror typeMirror) {
final ClassName typeName = (ClassName) TypeName.get(typeMirror);
final String packageName = typeName.packageName();
final String className = typeName.simpleName();
return ClassName.bestGuess(packageName + "." + Constants.DAGGER + className);
}
示例4: findComponent
import com.squareup.javapoet.ClassName; //导入方法依赖的package包/类
private ClassName findComponent(TypeMirror typeMirror) {
final ClassName typeName = (ClassName) TypeName.get(typeMirror);
final String packageName = typeName.packageName();
final String className = typeName.simpleName();
return ClassName.bestGuess(packageName + "." + className);
}
示例5: asString
import com.squareup.javapoet.ClassName; //导入方法依赖的package包/类
private String asString(ClassName className) {
return className.packageName() + "." + className.simpleName();
}