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