Appends one or more strings to the generated code.
@param codeFragments The code string(s) to append.
@return This CodeBuilder (for stringing together operations).
496344
public JsCodeBuilder append(String... codeFragments) {
    for (String codeFragment : codeFragments) {
      code.append(codeFragment);
    }
    return this;
  }
495906
protected void generateScriptSourceAppender() {
		final List<StringConcatenationClient> topElements = generateTopElements(false, true);
		final TypeReference appender = getCodeElementExtractor().getElementAppenderImpl("Script"); //$NON-NLS-1$
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Appender of " + getLanguageName() + " scripts."); //$NON-NLS-1$ //$NON-NLS-2$
				it.newLine();
				it.append(" *"); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public class "); //$NON-NLS-1$
				it.append(getScriptAppender().getSimpleName());
				it.append(" extends "); //$NON-NLS-1$
				it.append(getCodeElementExtractor().getAbstractAppenderImpl());
				it.append(" implements "); //$NON-NLS-1$
				it.append(getScriptBuilderInterface());
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateFieldsAndMethods(false, true));
				for (final StringConcatenationClient element : topElements) {
					it.append(element);
				}
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}

		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(appender, content);
		javaFile.writeTo(getSrcGen());
	}
514964
public static String join(String joiner, String... parts) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < parts.length; i++) {
            builder.append(parts[i]);
            if (i < parts.length - 1) {
                builder.append(joiner);
            }
        }
        return builder.toString();
    }
180265
private static void addStringList(CodeBlock.Builder code, List<String> list, String indent) {
    int size = list.size();
    code.add("$T.asList(\n$L", Arrays.class, indent);
    int width = indent.length();
    for (int i = 0; i < size; i++) {
      if (i != 0) {
        code.add(", ");
        width += 2;
      }
      if (width > 80) {
        width = indent.length();
        code.add("\n$L", indent);
      }
      String element = list.get(i);
      code.add("$S", element);
      width += element.length() + 2;
    }
    code.add("\n$L)", indent);
  }
1280053
protected void generateScriptBuilderImpl() {
		final List<StringConcatenationClient> topElements = generateTopElements(false, false);
		final TypeReference script = getScriptBuilderImpl();
		final TypeReference scriptInterface = getScriptBuilderInterface();
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public class "); //$NON-NLS-1$
				it.append(script.getSimpleName());
				it.append(" extends "); //$NON-NLS-1$
				it.append(getAbstractBuilderImpl());
				it.append(" implements "); //$NON-NLS-1$
				it.append(scriptInterface);
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateFieldsAndMethods(false, false));
				for (final StringConcatenationClient element : topElements) {
					it.append(element);
				}
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
			}

		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(script, content);
		javaFile.writeTo(getSrcGen());
	}
1351719
private void outputFragments(GinjectorBindings bindings,
      FragmentMap fragments, StringBuilder initializeEagerSingletonsBody,
      StringBuilder initializeStaticInjectionsBody, SourceWriteUtil sourceWriteUtil,
      SourceWriter writer) {
    String implClassName = ginjectorNameGenerator.getClassName(bindings);
    NameGenerator nameGenerator = bindings.getNameGenerator();

    for (FragmentPackageName fragmentPackageName : fragments.getFragmentPackages()) {
      String fragmentCanonicalClassName =
          nameGenerator.getFragmentCanonicalClassName(implClassName,
              fragmentPackageName);
      String fieldName = nameGenerator.getFragmentFieldName(fragmentPackageName);
      String getterName = nameGenerator.getFragmentGetterMethodName(fragmentPackageName);

      // Create the field.
      writer.beginJavaDocComment();
      writer.print("Injector fragment for %s", fragmentPackageName);
      writer.endJavaDocComment();
      writer.print("private %s %s = null;", fragmentCanonicalClassName, fieldName);

      // Write the getter.
      writer.beginJavaDocComment();
      writer.print("Getter for injector fragment for %s", fragmentPackageName);
      writer.endJavaDocComment();
      sourceWriteUtil.writeMethod(writer,
          "public " + fragmentCanonicalClassName + " " + getterName + "()", String.format(
          "if (%2$s == null) {\n"
        + "    %2$s = new %1$s(this);\n"
        + "}\n\n"
        + "return %2$s;", fragmentCanonicalClassName, fieldName));

      if (fragments.get(fragmentPackageName).hasEagerSingletonInitialization()) {
        initializeEagerSingletonsBody.append(getterName + "().initializeEagerSingletons();\n");
      }

      if (fragments.get(fragmentPackageName).hasStaticInjectionInitialization()) {
        initializeStaticInjectionsBody.append(getterName + "().initializeStaticInjections();\n");
      }
    }
  }
1363007
public static String add( String... strings ) {
        int length = 0;
        for ( String str : strings ) {
            if ( str == null ) {
                continue;
            }
            length += str.length();
        }
        CharBuf builder = CharBuf.createExact( length );
        for ( String str : strings ) {
            if ( str == null ) {
                continue;
            }
            builder.add( str );
        }
        return builder.toString();
    }
983430
B append(String path) {
    Preconditions.checkArgument(
        path != null && !path.isEmpty(), "'path' must be a non-empty String");
    ImmutableList.Builder<String> components = ImmutableList.builder();
    components.addAll(this.getSegments());
    components.add(splitChildPath(path));
    return createPathWithSegments(components.build());
  }
319859
public static String addQueryStringFragment(String url, String fragment) {
        StringBuilder newUrl = new StringBuilder(url);

        if (fragment.startsWith("?") || fragment.startsWith("&")) {
            fragment = fragment.substring(1);
        }

        if (!url.endsWith("?") && !url.endsWith("&")) {
            if (url.contains("?")) {
                newUrl.append('&');
            } else {
                newUrl.append('?');
            }
        }

        return newUrl.append(fragment).toString();
    }
397249
public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(List<StyledSegment<SEG, S>> styledSegments) {
        return addParagraph(styledSegments, null);
    }
55286
public JsCodeBuilder appendLine(String... codeFragments) {
    code.append(indent);
    append(codeFragments);
    code.append("\n");
    return this;
  }
710753
public ElementsBuilder addAll(HTMLElement... elements) {
        for (HTMLElement element : elements) {
            add(element);
        }
        return that();
    }
834703
protected void generateIElementBuilder() {
		final List<TopElementDescription> topElements = generateTopElements(true, false);
		for (final TopElementDescription element : topElements) {
			final StringConcatenationClient content = new StringConcatenationClient() {
				@Override
				protected void appendTo(TargetStringConcatenation it) {
					it.append("/** Builder of a " + getLanguageName() //$NON-NLS-1$
							+ " " + element.getElementDescription().getElementType().getSimpleName() //$NON-NLS-1$
							+ "."); //$NON-NLS-1$
					it.newLine();
					it.append(" */"); //$NON-NLS-1$
					it.newLine();
					it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
					it.newLine();
					it.append("public interface "); //$NON-NLS-1$
					it.append(element.getElementDescription().getBuilderInterfaceType().getSimpleName());
					it.append(" {"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
					it.append(element.getContent());
					for (final StringConcatenationClient cons : generateMembers(element.getConstructors(),
							element, true, false, true)) {
						it.append(cons);
					}
					for (final StringConcatenationClient mbr : generateMembers(element.getNamedMembers(),
							element, true, false, true)) {
						it.append(mbr);
					}
					for (final StringConcatenationClient mbr : generateMembers(element.getUnnamedMembers(),
							element, true, false, false)) {
						it.append(mbr);
					}
					it.append("}"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
				}
			};
			final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(
					element.getElementDescription().getBuilderInterfaceType(), content);
			javaFile.writeTo(getSrcGen());
		}
	}
140507
public JsCodeBuilder append(CodeChunk codeChunk) {
    codeChunk.collectRequires(requireCollector);
    return append(codeChunk.getStatementsForInsertingIntoForeignCodeAtIndent(indent.length()));
  }
725464
@Nonnull
  public HashCodeGenerator append (final boolean x)
  {
    _checkClosed ();
    m_nHC = HashCodeCalculator.append (m_nHC, x);
    return this;
  }
1310211
public UriComponentsBuilder pathSegment(String... pathSegments) throws IllegalArgumentException {
		Assert.notNull(pathSegments, "'segments' must not be null");
		this.pathBuilder.addPathSegments(pathSegments);
		resetSchemeSpecificPart();
		return this;
	}
1113354
protected void generateIScriptBuilder() {
		final List<StringConcatenationClient> topElements = generateTopElements(true, false);
		final TypeReference builder = getScriptBuilderInterface();
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Builder of " + getLanguageName() + " scripts."); //$NON-NLS-1$ //$NON-NLS-2$
				it.newLine();
				it.append(" *"); //$NON-NLS-1$
				it.newLine();
				it.append(" * <p>This builder is provided for helping to create " //$NON-NLS-1$
						+ getLanguageName()
						+ " Ecore elements."); //$NON-NLS-1$
				it.newLine();
				it.append(" *"); //$NON-NLS-1$
				it.newLine();
				it.append(" * <p>Do not forget to invoke {@link #finalizeScript()} for creating imports, etc."); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public interface "); //$NON-NLS-1$
				it.append(builder.getSimpleName());
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateFieldsAndMethods(true, false));
				for (final StringConcatenationClient element : topElements) {
					it.append(element);
				}
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}

		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(builder, content);
		javaFile.writeTo(getSrcGen());
	}