org.eclipse.xtext.util.Strings.concat()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(105)

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

Strings.concat介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.util

public static String concat(String separator, List<String> list) {
  return concat(separator, list, 0);
}

代码示例来源:origin: org.eclipse.xtext/util

public static String concat(String separator, List<String> list) {
  return concat(separator, list, 0);
}

代码示例来源:origin: org.eclipse.xtext/ui

public String getMergedIds(String[] ids) {
  return "$$$Merged:" + Strings.concat("/", Arrays.asList(ids)) + "$$$";
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

@Override
public String toString() {
  return String.format("typeof(%s%s)", String.valueOf(type), Strings.concat("", getArrayDimensions()));
}

代码示例来源:origin: org.eclipse/xtext

public static String getNamespace(Grammar g) {
  if (Strings.isEmpty(g.getName()))
    return null;
  String[] splitted = g.getName().split("\\.");
  return Strings.concat(".", Arrays.asList(splitted), 1);
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xbase

buffer.append(Strings.concat(" & ", upper));

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.common.types

public String getJavaFileName(IEObjectDescription description) {
  if (!isJvmDeclaredType(description)) {
    return null;
  }
  QualifiedName typeName = description.getName();
  return Strings.concat("/", typeName.getSegments()) + ".java";
}

代码示例来源:origin: org.eclipse.xtext/junit4

public ContentAssistProcessorTestBuilder assertTextAtCursorPosition(int cursorPosition, String... expectedText)
    throws Exception {
  String currentModelToParse = getModel();
  ICompletionProposal[] computeCompletionProposals = computeCompletionProposals(currentModelToParse,
      cursorPosition);
  if (computeCompletionProposals == null)
    computeCompletionProposals = new ICompletionProposal[0];
  Arrays.sort(expectedText);
  final String expectation = Strings.concat(", ", Arrays.asList(expectedText));
  final String actual = Strings.concat(", ", toString(computeCompletionProposals));
  
  Assert.assertEquals(expectation, actual);
  
  for (int i = 0; i < computeCompletionProposals.length; i++) {
    ICompletionProposal completionProposal = computeCompletionProposals[i];
    String proposedText = getProposedText(completionProposal);
    Assert.assertTrue("Missing proposal '" + proposedText + "'. Expect completionProposal text '" + expectation + "', but got " +
        actual,
        Arrays.asList(expectedText).contains(proposedText));
  }
  return this;
}

代码示例来源:origin: org.eclipse.xtend/org.eclipse.xtend.core

List<String> bootClassPathEntries = getBootClassPathEntries();
    if (!isEmpty(bootClassPathEntries)) {
      commandLine.add("-bootclasspath \"" + concat(File.pathSeparator, bootClassPathEntries) + "\"");
commandLine.add(concat(" ", transform(sourceDirectories, new Function<String, String>() {
  @Override
  public String apply(String path) {
  log.debug("invoke batch compiler with '" + concat(" ", commandLine) + "'");
return BatchCompiler.compile(concat(" ", commandLine), outWriter, outWriter, null);

代码示例来源:origin: io.sarl.lang/io.sarl.lang

logger.debug(Messages.EcjBatchCompiler_0, Strings.concat("\n", commandLineArguments)); //$NON-NLS-1$

代码示例来源:origin: io.sarl.lang/io.sarl.lang

logger.debug(Messages.JavacBatchCompiler_0, Strings.concat(" ", commandLineArguments)); //$NON-NLS-1$

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.builder.standalone

@Override
public CompilationResult compile(Iterable<String> sourceRoots, File outputClassDirectory) {
  Iterable<String> validSourceRoots = IterableExtensions.filter(sourceRoots, new EmptyOrMissingFilter());
  if (!containsJavaFiles(validSourceRoots)) {
    return CompilationResult.SKIPPED;
  }
  List<String> commandLine = Lists.newArrayList();
  if (configuration.isVerbose()) {
    commandLine.add("-verbose");
  }
  if (classPath != null) {
    Iterable<String> validClasspath = IterableExtensions.filter(classPath, new EmptyOrMissingFilter());
    if (validClasspath.iterator().hasNext()) {
      commandLine.add("-cp \"" + concat(File.pathSeparator, Lists.newArrayList(validClasspath)) + "\"");
    }
  }
  commandLine.add("-d \"" + outputClassDirectory.toString() + "\"");
  commandLine.add("-source " + configuration.getSourceLevel());
  commandLine.add("-target " + configuration.getTargetLevel());
  commandLine.add("-proceedOnError");
  for (String src : validSourceRoots) {
    commandLine.add("\"" + src + "\"");
  }
  String cmdLine = concat(" ", commandLine);
  debugLog("invoke batch compiler with '" + cmdLine + "'");
  boolean result = BatchCompiler.compile(cmdLine, new PrintWriter(getOutputWriter()), new PrintWriter(
      getErrorWriter()), null);
  return result ? CompilationResult.SUCCEEDED : CompilationResult.FAILED;
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.xtext.generator

protected void normalizeTokens(final IXtextGeneratorFileSystemAccess fsa, final String tokenFile) {
 String content = fsa.readTextFile(tokenFile).toString();
 content = this.newLineNormalizer.postProcess(fsa.getURI(tokenFile), content).toString();
 final List<String> splitted = Strings.split(content, this.codeConfig.getLineDelimiter());
 Collections.<String>sort(splitted);
 String _concat = Strings.concat(this.codeConfig.getLineDelimiter(), splitted);
 String _lineDelimiter = this.codeConfig.getLineDelimiter();
 String _plus = (_concat + _lineDelimiter);
 content = _plus;
 fsa.generateFile(tokenFile, content);
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.junit4

public ContentAssistProcessorTestBuilder assertTextAtCursorPosition(int cursorPosition, String... expectations)
    throws Exception {
  String currentModelToParse = getFullTextToBeParsed();
  ICompletionProposal[] computeCompletionProposals = computeCompletionProposals(currentModelToParse,
      cursorPosition);
  if (computeCompletionProposals == null)
    computeCompletionProposals = new ICompletionProposal[0];
  Arrays.sort(expectations);
  List<String> sortedExpectations = Lists.newArrayList();
  for (String expectation : expectations) {
    sortedExpectations.add(LineDelimiters.toPlatform(expectation));
  }
  final String expectation = Strings.concat(Strings.newLine(), sortedExpectations);
  final String actual = Strings.concat(Strings.newLine(), toString(computeCompletionProposals));
  
  Assert.assertEquals(expectation, actual);
  
  for (int i = 0; i < computeCompletionProposals.length; i++) {
    ICompletionProposal completionProposal = computeCompletionProposals[i];
    String proposedText = getProposedText(completionProposal);
    Assert.assertTrue("Missing proposal '" + proposedText + "'. Expect completionProposal text '" + expectation + "', but got " +
        actual,
        sortedExpectations.contains(proposedText));
  }
  return this;
}

代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.mwe2.language

List<String> missingAssignments = Lists.newArrayList(mandatoryFeatures.keySet());
Collections.sort(missingAssignments);
String concatenated = Strings.concat(", ", missingAssignments);
EStructuralFeature feature = null;
if (component.getType() != null)

代码示例来源:origin: org.codehaus.openxma/dsl-dom

if (isScalarType(type)) {
  error("Unsupported identifier datatype '" + identifierAttribute.getDataTypeName()
      + "'. Supported types are: " + Strings.concat(",", SUPPORTED_ID_TYPES) + ".",
      DomPackage.eINSTANCE.getAttribute_Type());
      "."))) {
error("Unsupported instance datatype '" + simpleType.getInstanceTypeName()
    + "'. Supported types are: " + Strings.concat(",", SUPPORTED_VERSION_TYPES) + ".",
    DomPackage.eINSTANCE.getAttribute_Type());

相关文章