本文整理汇总了Java中org.eclipse.xtext.xbase.lib.IterableExtensions.join方法的典型用法代码示例。如果您正苦于以下问题:Java IterableExtensions.join方法的具体用法?Java IterableExtensions.join怎么用?Java IterableExtensions.join使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.xbase.lib.IterableExtensions
的用法示例。
在下文中一共展示了IterableExtensions.join方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTypeAsString
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getTypeAsString() {
String _xifexpression = null;
boolean _isGeneric = this.isGeneric();
if (_isGeneric) {
String _name = this.getName();
String _plus = (_name + "<");
final Function1<TypeVariable, String> _function = new Function1<TypeVariable, String>() {
public String apply(final TypeVariable it) {
return it.getTypeAsString();
}
};
String _join = IterableExtensions.join(XcoreEListExtensions.<TypeVariable, String>map(this.getTypeVars(), _function), ",");
String _plus_1 = (_plus + _join);
_xifexpression = (_plus_1 + ">");
}
else {
_xifexpression = this.getName();
}
return _xifexpression;
}
示例2: toString
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
@Override
public String toString() {
String _xifexpression = null;
if ((this.first != null)) {
String _xblockexpression = null;
{
final ArrayList<String> list = CollectionLiterals.<String>newArrayList();
Entry<T, R> current = this.first.getLeadingSeparator();
while ((current != null)) {
{
String _string = current.toString();
list.add(_string);
current = current.next;
}
}
_xblockexpression = IterableExtensions.join(list, "\n");
}
_xifexpression = _xblockexpression;
} else {
_xifexpression = "empty";
}
return _xifexpression;
}
示例3: collectResources
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected List<URI> collectResources(final Iterable<String> roots, final ResourceSet resourceSet) {
final String extensions = IterableExtensions.join(this.languages.keySet(), "|");
final NameBasedFilter nameBasedFilter = new NameBasedFilter();
nameBasedFilter.setRegularExpression(((".*\\.(?:(" + extensions) + "))$"));
final List<URI> resources = CollectionLiterals.<URI>newArrayList();
final Predicate<URI> _function = (URI input) -> {
final boolean matches = nameBasedFilter.matches(input);
if (matches) {
this.forceDebugLog((("Adding file \'" + input) + "\'"));
resources.add(input);
}
return matches;
};
final Multimap<String, URI> modelsFound = new PathTraverser().resolvePathes(
IterableExtensions.<String>toList(roots), _function);
final BiConsumer<String, Collection<URI>> _function_1 = (String uri, Collection<URI> resource) -> {
final File file = new File(uri);
if ((((resource != null) && (!file.isDirectory())) && file.getName().endsWith(".jar"))) {
this.registerBundle(file);
}
};
modelsFound.asMap().forEach(_function_1);
return resources;
}
示例4: _toExpectation
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected String _toExpectation(final Command it) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("command : ");
String _command = it.getCommand();
_builder.append(_command);
_builder.newLineIfNotEmpty();
_builder.append("title : ");
String _title = it.getTitle();
_builder.append(_title);
_builder.newLineIfNotEmpty();
_builder.append("args : ");
_builder.newLine();
_builder.append("\t");
final Function1<Object, CharSequence> _function = (Object it_1) -> {
return this.toExpectation(it_1);
};
String _join = IterableExtensions.<Object>join(it.getArguments(), ",", _function);
_builder.append(_join, "\t");
_builder.newLineIfNotEmpty();
return _builder.toString();
}
示例5: toPattern
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected Pattern toPattern(final TaskTags taskTags) {
Pattern _xblockexpression = null;
{
int flags = Pattern.MULTILINE;
boolean _isCaseSensitive = taskTags.isCaseSensitive();
boolean _not = (!_isCaseSensitive);
if (_not) {
flags = ((flags | Pattern.CASE_INSENSITIVE) | Pattern.UNICODE_CASE);
}
StringConcatenation _builder = new StringConcatenation();
_builder.append("^.*((");
final Function1<TaskTag, String> _function = (TaskTag it) -> {
return Pattern.quote(it.getName());
};
String _join = IterableExtensions.join(IterableExtensions.<TaskTag, String>map(taskTags, _function), "|");
_builder.append(_join);
_builder.append(")(.*)?)$");
_xblockexpression = Pattern.compile(_builder.toString(), flags);
}
return _xblockexpression;
}
示例6: getTypeRefAsString
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getTypeRefAsString() {
final Function1<TypeRef, String> _function = new Function1<TypeRef, String>() {
public String apply(final TypeRef it) {
return it.getTypeRefAsString();
}
};
String _join = IterableExtensions.join(XcoreEListExtensions.<TypeRef, String>map(this.getTypeRefs(), _function), ",");
String _plus = ("{" + _join);
String _plus_1 = (_plus + "}");
String _modifiersAsString = this.getModifiersAsString();
return (_plus_1 + _modifiersAsString);
}
示例7: getTypeRefAsString
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getTypeRefAsString() {
Type _declaredType = this.getDeclaredType();
String _rawTypeAsString = null;
if (_declaredType!=null) {
_rawTypeAsString=_declaredType.getRawTypeAsString();
}
String _xifexpression = null;
int _version = this.getVersion();
boolean _greaterThan = (_version > 0);
if (_greaterThan) {
int _version_1 = this.getVersion();
_xifexpression = ("#" + Integer.valueOf(_version_1));
}
else {
String _xifexpression_1 = null;
boolean _isEmpty = this.getTypeArgs().isEmpty();
if (_isEmpty) {
_xifexpression_1 = "";
}
else {
final Function1<TypeArgument, String> _function = new Function1<TypeArgument, String>() {
public String apply(final TypeArgument it) {
return it.getTypeRefAsString();
}
};
String _join = IterableExtensions.join(XcoreEListExtensions.<TypeArgument, String>map(this.getTypeArgs(), _function), ",");
String _plus = ("<" + _join);
_xifexpression_1 = (_plus + ">");
}
String _plus_1 = ("" + _xifexpression_1);
String _modifiersAsString = this.getModifiersAsString();
_xifexpression = (_plus_1 + _modifiersAsString);
}
return (_rawTypeAsString + _xifexpression);
}
示例8: getDefaultArgumentList
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
/**
* @since 2.9
*/
public static String getDefaultArgumentList(ParserRule rule) {
String result = IterableExtensions.join(rule.getParameters(), "[", ", ", "]", new Functions.Function1<Parameter, String>() {
@Override
public String apply(Parameter p) {
return Boolean.FALSE.toString();
}
});
return result;
}
示例9: _toJava
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected String _toJava(final PrimitiveType type) {
String _name = type.getName();
final Function1<String, String> _function = (String it) -> {
return "[]";
};
String _join = IterableExtensions.join(ListExtensions.<String, String>map(type.getArrayDiemensions(), _function), "");
return (_name + _join);
}
示例10: elementAliasToIdentifier
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected String elementAliasToIdentifier(final GrammarAlias.AbstractElementAlias alias) {
final Set<String> rulesSet = CollectionLiterals.<String>newHashSet();
final String body = this.elementAliasToIdentifier(alias, rulesSet, false);
final List<String> rulesList = CollectionLiterals.<String>newArrayList(((String[])Conversions.unwrapArray(rulesSet, String.class)));
ListExtensions.<String>sortInplace(rulesList);
final String rule = IterableExtensions.join(rulesList, "_");
return ((rule + "_") + body);
}
示例11: compileStubs
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
protected String compileStubs(final File stubsDir) {
final File stubsClasses = this.createTempDir("classes");
this.compiler.setClassPath(this.classPathEntries);
String _absolutePath = stubsDir.getAbsolutePath();
String _plus = ("Compiling stubs located in " + _absolutePath);
StandaloneBuilder.LOG.info(_plus);
Iterable<String> _plus_1 = Iterables.<String>concat(this.javaSourceDirs, this.sourceDirs);
ArrayList<String> _newArrayList = CollectionLiterals.<String>newArrayList(stubsDir.getAbsolutePath());
Iterable<String> _plus_2 = Iterables.<String>concat(_plus_1, _newArrayList);
final Set<String> sourcesToCompile = this.uniqueEntries(_plus_2);
String _join = IterableExtensions.join(sourcesToCompile, ",");
String _plus_3 = ("Compiler source roots: " + _join);
this.forceDebugLog(_plus_3);
final IJavaCompiler.CompilationResult result = this.compiler.compile(sourcesToCompile, stubsClasses);
if (result != null) {
switch (result) {
case SKIPPED:
StandaloneBuilder.LOG.info("Nothing to compile. Stubs compilation was skipped.");
break;
case FAILED:
this.forceDebugLog("Stubs compilation finished with errors.");
break;
case SUCCEEDED:
this.forceDebugLog("Stubs compilation successfully finished.");
break;
default:
break;
}
}
return stubsClasses.getAbsolutePath();
}
示例12: installStubs
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
public void installStubs(final Resource resource) {
boolean _isInfoFile = this.isInfoFile(resource);
if (_isInfoFile) {
return;
}
final CompilationUnit compilationUnit = this.getCompilationUnit(resource);
IErrorHandlingPolicy _proceedWithAllProblems = DefaultErrorHandlingPolicies.proceedWithAllProblems();
CompilerOptions _compilerOptions = this.getCompilerOptions(resource);
DefaultProblemFactory _defaultProblemFactory = new DefaultProblemFactory();
ProblemReporter _problemReporter = new ProblemReporter(_proceedWithAllProblems, _compilerOptions, _defaultProblemFactory);
final Parser parser = new Parser(_problemReporter, true);
final CompilationResult compilationResult = new CompilationResult(compilationUnit, 0, 1, (-1));
final CompilationUnitDeclaration result = parser.dietParse(compilationUnit, compilationResult);
if ((result.types != null)) {
for (final TypeDeclaration type : result.types) {
{
ImportReference _currentPackage = result.currentPackage;
char[][] _importName = null;
if (_currentPackage!=null) {
_importName=_currentPackage.getImportName();
}
List<String> _map = null;
if (((List<char[]>)Conversions.doWrapArray(_importName))!=null) {
final Function1<char[], String> _function = (char[] it) -> {
return String.valueOf(it);
};
_map=ListExtensions.<char[], String>map(((List<char[]>)Conversions.doWrapArray(_importName)), _function);
}
String _join = null;
if (_map!=null) {
_join=IterableExtensions.join(_map, ".");
}
final String packageName = _join;
final JvmDeclaredType jvmType = this.createType(type, packageName);
resource.getContents().add(jvmType);
}
}
}
}
示例13: buildPropertiesEntry
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
private String buildPropertiesEntry(final String key, final Iterable<String> value) {
String _xblockexpression = null;
{
boolean _isEmpty = IterableExtensions.isEmpty(value);
if (_isEmpty) {
return "";
}
final String assignment = (key + " = ");
final String indent = Strings.repeat(" ", assignment.length());
String _join = IterableExtensions.join(value, (",\\\n" + indent));
_xblockexpression = (assignment + _join);
}
return _xblockexpression;
}
示例14: getPackageName
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
private static String getPackageName(final String qualifiedName, final boolean strict) {
final List<String> segments = IterableExtensions.<String>toList(Splitter.on(".").split(qualifiedName));
int _size = segments.size();
boolean _equals = (_size == 1);
if (_equals) {
return "";
}
if (strict) {
int _length = ((Object[])Conversions.unwrapArray(segments, Object.class)).length;
int _minus = (_length - 1);
final List<String> packageSegments = segments.subList(0, _minus);
final Function1<String, Boolean> _function = (String it) -> {
return Boolean.valueOf(Character.isUpperCase(it.charAt(0)));
};
boolean _isEmpty = IterableExtensions.isEmpty(IterableExtensions.<String>filter(packageSegments, _function));
boolean _not = (!_isEmpty);
if (_not) {
throw new IllegalArgumentException((("Cannot determine the package name of \'" + qualifiedName) + "\'. Please use the TypeReference(packageName, className) constructor"));
}
return IterableExtensions.join(packageSegments, ".");
} else {
int _length_1 = ((Object[])Conversions.unwrapArray(segments, Object.class)).length;
int _minus_1 = (_length_1 - 1);
List<String> packageSegments_1 = segments.subList(0, _minus_1);
while ((!packageSegments_1.isEmpty())) {
boolean _isUpperCase = Character.isUpperCase(IterableExtensions.<String>last(packageSegments_1).charAt(0));
if (_isUpperCase) {
final List<String> _converted_packageSegments_1 = (List<String>)packageSegments_1;
int _length_2 = ((Object[])Conversions.unwrapArray(_converted_packageSegments_1, Object.class)).length;
int _minus_2 = (_length_2 - 1);
packageSegments_1 = packageSegments_1.subList(0, _minus_2);
} else {
return IterableExtensions.join(packageSegments_1, ".");
}
}
return "";
}
}
示例15: getSimpleMethodName
import org.eclipse.xtext.xbase.lib.IterableExtensions; //导入方法依赖的package包/类
private String getSimpleMethodName(final TypeReference type) {
String _join = IterableExtensions.join(type.getSimpleNames(), "$");
final Function1<TypeReference, CharSequence> _function = (TypeReference it) -> {
return this.getSimpleMethodName(it);
};
String _join_1 = IterableExtensions.<TypeReference>join(type.getTypeArguments(), "$", "$", "", _function);
return (_join + _join_1);
}