/** * Emit type variables with their bounds. This should only be used when declaring type variables; * everywhere else bounds are omitted. */ public void emitTypeVariables(List<TypeVariableName> typeVariables) throws IOException { if (typeVariables.isEmpty()) return; typeVariables.forEach(typeVariable -> currentTypeVariables.add(typeVariable.name)); emit("<"); boolean firstTypeVariable = true; for (TypeVariableName typeVariable : typeVariables) { if (!firstTypeVariable) emit(", "); emitAnnotations(typeVariable.annotations, true); emit("$L", typeVariable.name); boolean firstBound = true; for (TypeName bound : typeVariable.bounds) { emit(firstBound ? " extends $T" : " & $T", bound); firstBound = false; } firstTypeVariable = false; } emit(">"); }
void emit(CodeWriter codeWriter, boolean varargs) throws IOException { codeWriter.emitAnnotations(annotations, true); codeWriter.emitModifiers(modifiers); if (varargs) { TypeName.asArray(type).emit(codeWriter, true); } else { type.emit(codeWriter); } codeWriter.emit(" $L", name); }
void emit(CodeWriter codeWriter, Set<Modifier> implicitModifiers) throws IOException { codeWriter.emitJavadoc(javadoc); codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, implicitModifiers); codeWriter.emit("$T $L", type, name); if (!initializer.isEmpty()) { codeWriter.emit(" = "); codeWriter.emit(initializer); } codeWriter.emit(";\n"); }
if (enumName != null) { codeWriter.emitJavadoc(javadoc); codeWriter.emitAnnotations(annotations, false); codeWriter.emit("$L", enumName); if (!anonymousTypeArguments.formatParts.isEmpty()) { codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, Util.union(implicitModifiers, kind.asMemberModifiers)); if (kind == Kind.ANNOTATION) {
void emit(CodeWriter codeWriter, String enclosingName, Set<Modifier> implicitModifiers) throws IOException { codeWriter.emitJavadoc(javadocWithParameters()); codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, implicitModifiers);
void emit(CodeWriter codeWriter, boolean varargs) throws IOException { codeWriter.emitAnnotations(annotations, true); codeWriter.emitModifiers(modifiers); if (varargs) { codeWriter.emit("$T... $L", TypeName.arrayComponent(type), name); } else { codeWriter.emit("$T $L", type, name); } }
void emit(CodeWriter codeWriter, boolean varargs) throws IOException { codeWriter.emitAnnotations(annotations, true); codeWriter.emitModifiers(modifiers); if (varargs) { codeWriter.emit("$T... $L", TypeName.arrayComponent(type), name); } else { codeWriter.emit("$T $L", type, name); } }
/** * Emit type variables with their bounds. This should only be used when declaring type variables; * everywhere else bounds are omitted. */ public void emitTypeVariables(List<TypeVariableName> typeVariables) throws IOException { if (typeVariables.isEmpty()) return; emit("<"); boolean firstTypeVariable = true; for (TypeVariableName typeVariable : typeVariables) { if (!firstTypeVariable) emit(", "); emitAnnotations(typeVariable.annotations, true); emit("$L", typeVariable.name); boolean firstBound = true; for (TypeName bound : typeVariable.bounds) { emit(firstBound ? " extends $T" : " & $T", bound); firstBound = false; } firstTypeVariable = false; } emit(">"); }
/** * Emit type variables with their bounds. This should only be used when declaring type variables; * everywhere else bounds are omitted. */ public void emitTypeVariables(List<TypeVariableName> typeVariables) throws IOException { if (typeVariables.isEmpty()) return; emit("<"); boolean firstTypeVariable = true; for (TypeVariableName typeVariable : typeVariables) { if (!firstTypeVariable) emit(", "); emitAnnotations(typeVariable.annotations, true); emit("$L", typeVariable.name); boolean firstBound = true; for (TypeName bound : typeVariable.bounds) { emit(firstBound ? " extends $T" : " & $T", bound); firstBound = false; } firstTypeVariable = false; } emit(">"); }
void emit(CodeWriter codeWriter, Set<Modifier> implicitModifiers) throws IOException { codeWriter.emitJavadoc(javadoc); codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, implicitModifiers); codeWriter.emit("$T $L", type, name); if (!initializer.isEmpty()) { codeWriter.emit(" = "); codeWriter.emit(initializer); } codeWriter.emit(";\n"); }
void emit(CodeWriter codeWriter, Set<Modifier> implicitModifiers) throws IOException { codeWriter.emitJavadoc(javadoc); codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, implicitModifiers); codeWriter.emit("$T $L", type, name); if (!initializer.isEmpty()) { codeWriter.emit(" = "); codeWriter.emit(initializer); } codeWriter.emit(";\n"); }
if (enumName != null) { codeWriter.emitJavadoc(javadoc); codeWriter.emitAnnotations(annotations, false); codeWriter.emit("$L", enumName); if (!anonymousTypeArguments.formatParts.isEmpty()) { codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, Util.union(implicitModifiers, kind.asMemberModifiers)); if (kind == Kind.ANNOTATION) {
if (enumName != null) { codeWriter.emitJavadoc(javadoc); codeWriter.emitAnnotations(annotations, false); codeWriter.emit("$L", enumName); if (!anonymousTypeArguments.formatParts.isEmpty()) { codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, Util.union(implicitModifiers, kind.asMemberModifiers)); if (kind == Kind.ANNOTATION) {
void emit(CodeWriter codeWriter, String enclosingName, Set<Modifier> implicitModifiers) throws IOException { codeWriter.emitJavadoc(javadoc); codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, implicitModifiers);
void emit(CodeWriter codeWriter, String enclosingName, Set<Modifier> implicitModifiers) throws IOException { codeWriter.emitJavadoc(javadoc); codeWriter.emitAnnotations(annotations, false); codeWriter.emitModifiers(modifiers, implicitModifiers);