com.squareup.javapoet.ClassName.emitAnnotations()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中com.squareup.javapoet.ClassName.emitAnnotations()方法的一些代码示例,展示了ClassName.emitAnnotations()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ClassName.emitAnnotations()方法的具体详情如下:
包路径:com.squareup.javapoet.ClassName
类名称:ClassName
方法名:emitAnnotations

ClassName.emitAnnotations介绍

暂无

代码示例

代码示例来源:origin: square/javapoet

className.emitAnnotations(out);

代码示例来源:origin: io.virtdata/virtdata-lib-realer

@Override CodeWriter emit(CodeWriter out) throws IOException {
 if (enclosingType != null) {
  enclosingType.emitAnnotations(out);
  enclosingType.emit(out);
  out.emit("." + rawType.simpleName());
 } else {
  rawType.emitAnnotations(out);
  rawType.emit(out);
 }
 if (!typeArguments.isEmpty()) {
  out.emitAndIndent("<");
  boolean firstParameter = true;
  for (TypeName parameter : typeArguments) {
   if (!firstParameter) out.emitAndIndent(", ");
   parameter.emitAnnotations(out);
   parameter.emit(out);
   firstParameter = false;
  }
  out.emitAndIndent(">");
 }
 return out;
}

代码示例来源:origin: xiaoxiangyeyuHeaven/JD-shopping-mall

@Override CodeWriter emit(CodeWriter out) throws IOException {
 if (enclosingType != null) {
  enclosingType.emitAnnotations(out);
  enclosingType.emit(out);
  out.emit("." + rawType.simpleName());
 } else {
  rawType.emitAnnotations(out);
  rawType.emit(out);
 }
 if (!typeArguments.isEmpty()) {
  out.emitAndIndent("<");
  boolean firstParameter = true;
  for (TypeName parameter : typeArguments) {
   if (!firstParameter) out.emitAndIndent(", ");
   parameter.emitAnnotations(out);
   parameter.emit(out);
   firstParameter = false;
  }
  out.emitAndIndent(">");
 }
 return out;
}

相关文章