CodeWriter emit(CodeWriter out) throws IOException { if (keyword == null) throw new AssertionError(); if (isAnnotated()) { out.emit(""); emitAnnotations(out); } return out.emitAndIndent(keyword); }
@Override public final String toString() { String result = cachedString; if (result == null) { try { StringBuilder resultBuilder = new StringBuilder(); CodeWriter codeWriter = new CodeWriter(resultBuilder); emitAnnotations(codeWriter); emit(codeWriter); result = resultBuilder.toString(); cachedString = result; } catch (IOException e) { throw new AssertionError(); } } return result; }
@Override public final String toString() { String result = cachedString; if (result == null) { try { StringBuilder resultBuilder = new StringBuilder(); CodeWriter codeWriter = new CodeWriter(resultBuilder); emitAnnotations(codeWriter); emit(codeWriter); result = resultBuilder.toString(); cachedString = result; } catch (IOException e) { throw new AssertionError(); } } return result; }
TypeName typeName = (TypeName) codeBlock.args.get(a++); if (typeName.isAnnotated()) { typeName.emitAnnotations(this); typeName = typeName.withoutAnnotations();
TypeName typeName = (TypeName) codeBlock.args.get(a++); if (typeName.isAnnotated()) { typeName.emitAnnotations(this); typeName = typeName.withoutAnnotations();
@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; }
@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; }