当前位置: 首页>>代码示例>>Java>>正文


Java ObjectExtensions.operator_doubleArrow方法代码示例

本文整理汇总了Java中org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectExtensions.operator_doubleArrow方法的具体用法?Java ObjectExtensions.operator_doubleArrow怎么用?Java ObjectExtensions.operator_doubleArrow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.xtext.xbase.lib.ObjectExtensions的用法示例。


在下文中一共展示了ObjectExtensions.operator_doubleArrow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toTypeReference

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
protected JvmTypeReference toTypeReference(final JvmType type, final int arrayDimensions) {
  if ((type == null)) {
    return null;
  }
  JvmParameterizedTypeReference _createJvmParameterizedTypeReference = TypesFactory.eINSTANCE.createJvmParameterizedTypeReference();
  final Procedure1<JvmParameterizedTypeReference> _function = (JvmParameterizedTypeReference it) -> {
    it.setType(type);
  };
  JvmTypeReference resultTypeRef = ObjectExtensions.<JvmParameterizedTypeReference>operator_doubleArrow(_createJvmParameterizedTypeReference, _function);
  ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, arrayDimensions, true);
  for (final Integer i : _doubleDotLessThan) {
    {
      final JvmGenericArrayTypeReference arrayRef = TypesFactory.eINSTANCE.createJvmGenericArrayTypeReference();
      arrayRef.setComponentType(resultTypeRef);
      resultTypeRef = arrayRef;
    }
  }
  return resultTypeRef;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:20,代码来源:AbstractConstantExpressionsInterpreter.java

示例2: setContext

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
@Override
public void setContext(final Notifier ctx) {
  IResourceDescriptions _localDescriptions = this.getLocalDescriptions();
  final Procedure1<ResourceSetBasedResourceDescriptions> _function = (ResourceSetBasedResourceDescriptions it) -> {
    it.setContext(ctx);
    it.setData(null);
  };
  ObjectExtensions.<ResourceSetBasedResourceDescriptions>operator_doubleArrow(((ResourceSetBasedResourceDescriptions) _localDescriptions), _function);
  final ResourceSet resourceSet = EcoreUtil2.getResourceSet(ctx);
  this.setGlobalDescriptions(ChunkedResourceDescriptions.findInEmfObject(resourceSet));
  IProjectConfig _projectConfig = null;
  if (this.projectConfigProvider!=null) {
    _projectConfig=this.projectConfigProvider.getProjectConfig(resourceSet);
  }
  IWorkspaceConfig _workspaceConfig = null;
  if (_projectConfig!=null) {
    _workspaceConfig=_projectConfig.getWorkspaceConfig();
  }
  this.workspaceConfig = _workspaceConfig;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:21,代码来源:LiveShadowedChunkedResourceDescriptions.java

示例3: testOffSet

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
@Test
public void testOffSet() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("hello world");
  _builder.newLine();
  _builder.append("foo");
  _builder.newLine();
  _builder.append("bar");
  _builder.newLine();
  String _normalize = this.normalize(_builder);
  Document _document = new Document(1, _normalize);
  final Procedure1<Document> _function = (Document it) -> {
    Assert.assertEquals(0, it.getOffSet(this.position(0, 0)));
    Assert.assertEquals(11, it.getOffSet(this.position(0, 11)));
    try {
      it.getOffSet(this.position(0, 12));
      Assert.fail();
    } catch (final Throwable _t) {
      if (_t instanceof IndexOutOfBoundsException) {
      } else {
        throw Exceptions.sneakyThrow(_t);
      }
    }
    Assert.assertEquals(12, it.getOffSet(this.position(1, 0)));
    Assert.assertEquals(13, it.getOffSet(this.position(1, 1)));
    Assert.assertEquals(14, it.getOffSet(this.position(1, 2)));
    Assert.assertEquals(16, it.getOffSet(this.position(2, 0)));
    Assert.assertEquals(19, it.getOffSet(this.position(2, 3)));
  };
  ObjectExtensions.<Document>operator_doubleArrow(_document, _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:32,代码来源:DocumentTest.java

示例4: afterBuild

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
@Override
public void afterBuild(final List<IResourceDescription.Delta> deltas) {
  TestLangLSPExtension.BuildNotification _buildNotification = new TestLangLSPExtension.BuildNotification();
  final Procedure1<TestLangLSPExtension.BuildNotification> _function = (TestLangLSPExtension.BuildNotification it) -> {
    final Function1<IResourceDescription.Delta, String> _function_1 = (IResourceDescription.Delta it_1) -> {
      return it_1.getUri().toString();
    };
    String _join = IterableExtensions.join(ListExtensions.<IResourceDescription.Delta, String>map(deltas, _function_1), ", ");
    String _plus = ("Built " + _join);
    it.message = _plus;
  };
  TestLangLSPExtension.BuildNotification _doubleArrow = ObjectExtensions.<TestLangLSPExtension.BuildNotification>operator_doubleArrow(_buildNotification, _function);
  this.client.buildHappened(_doubleArrow);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:15,代码来源:TestLangLSPExtension.java

示例5: position

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
private Position position(final int l, final int c) {
  Position _position = new Position();
  final Procedure1<Position> _function = (Position it) -> {
    it.setLine(l);
    it.setCharacter(c);
  };
  return ObjectExtensions.<Position>operator_doubleArrow(_position, _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:9,代码来源:DocumentTest.java

示例6: testResponseError

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
@Test
public void testResponseError() {
  ResponseMessage _responseMessage = new ResponseMessage();
  final Procedure1<ResponseMessage> _function = (ResponseMessage it) -> {
    it.setJsonrpc("2.0");
    it.setId("12");
    ResponseError _responseError = new ResponseError();
    final Procedure1<ResponseError> _function_1 = (ResponseError it_1) -> {
      it_1.setCode(ResponseErrorCode.InvalidRequest);
      it_1.setMessage("Could not parse request.");
    };
    ResponseError _doubleArrow = ObjectExtensions.<ResponseError>operator_doubleArrow(_responseError, _function_1);
    it.setError(_doubleArrow);
  };
  final ResponseMessage message = ObjectExtensions.<ResponseMessage>operator_doubleArrow(_responseMessage, _function);
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("{");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("\"jsonrpc\": \"2.0\",");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("\"id\": \"12\",");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("\"error\": {");
  _builder.newLine();
  _builder.append("    ");
  _builder.append("\"code\": -32600,");
  _builder.newLine();
  _builder.append("    ");
  _builder.append("\"message\": \"Could not parse request.\"");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("}");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  this.assertSerialize(message, _builder);
}
 
开发者ID:eclipse,项目名称:lsp4j,代码行数:41,代码来源:JsonSerializeTest.java

示例7: addArtifact

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
/**
 * Method to add an artifact.
 * 
 * @param initializer	DM_Artifact entity to be added.
 */
public void addArtifact(final Procedure1<? super DM_Artifact> initializer) {
  DM_Artifact _dM_Artifact = new DM_Artifact();
  final DM_Artifact artifactToAdd = ObjectExtensions.<DM_Artifact>operator_doubleArrow(_dM_Artifact, initializer);
  List<DM_Artifact> _artifacts = this.getArtifacts();
  _artifacts.add(artifactToAdd);
}
 
开发者ID:visor-vu,项目名称:chariot,代码行数:12,代码来源:DM_Device.java

示例8: pom

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
@Override
public PomFile pom() {
  PomFile _pom = super.pom();
  final Procedure1<PomFile> _function = (PomFile it) -> {
    it.setPackaging("eclipse-target-definition");
  };
  return ObjectExtensions.<PomFile>operator_doubleArrow(_pom, _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:9,代码来源:TargetPlatformProject.java

示例9: testListUpperBound

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
@Test
public void testListUpperBound() {
  ParameterizedTypeReference _typeRef = this.typeRef(List.class);
  final Procedure1<ParameterizedTypeReference> _function = (ParameterizedTypeReference it) -> {
    WildcardTypeReference _newWildcardTypeReference = it.getOwner().newWildcardTypeReference();
    final Procedure1<WildcardTypeReference> _function_1 = (WildcardTypeReference it_1) -> {
      it_1.addUpperBound(this.typeRef(CharSequence.class));
    };
    WildcardTypeReference _doubleArrow = ObjectExtensions.<WildcardTypeReference>operator_doubleArrow(_newWildcardTypeReference, _function_1);
    it.addTypeArgument(_doubleArrow);
  };
  this.assertInXtendAndJava(ObjectExtensions.<ParameterizedTypeReference>operator_doubleArrow(_typeRef, _function), "java.util.List<? extends java.lang.CharSequence>");
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:14,代码来源:LightweightTypeReferenceSerializerTest.java

示例10: configureIEncodingProvider

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
public void configureIEncodingProvider(final Binder binder) {
  AnnotatedBindingBuilder<IEncodingProvider> _bind = binder.<IEncodingProvider>bind(IEncodingProvider.class);
  IEncodingProvider.Runtime _runtime = new IEncodingProvider.Runtime();
  final Procedure1<IEncodingProvider.Runtime> _function = (IEncodingProvider.Runtime it) -> {
    it.setDefaultEncoding(this.code.getEncoding());
  };
  IEncodingProvider.Runtime _doubleArrow = ObjectExtensions.<IEncodingProvider.Runtime>operator_doubleArrow(_runtime, _function);
  _bind.toInstance(_doubleArrow);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:10,代码来源:DefaultGeneratorModule.java

示例11: createBundleDependency

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
public static ExternalDependency createBundleDependency(final String bundleId) {
  ExternalDependency _externalDependency = new ExternalDependency();
  final Procedure1<ExternalDependency> _function = (ExternalDependency it) -> {
    it.p2.bundleId = bundleId;
  };
  return ObjectExtensions.<ExternalDependency>operator_doubleArrow(_externalDependency, _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:8,代码来源:ExternalDependency.java

示例12: createXtextDependency

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
public static ExternalDependency createXtextDependency(final String xtextBundle) {
  ExternalDependency _externalDependency = new ExternalDependency();
  final Procedure1<ExternalDependency> _function = (ExternalDependency it) -> {
    it.p2.bundleId = xtextBundle;
    final Procedure1<ExternalDependency.MavenCoordinates> _function_1 = (ExternalDependency.MavenCoordinates it_1) -> {
      it_1.groupId = "org.eclipse.xtext";
      it_1.artifactId = xtextBundle;
      it_1.version = "${xtextVersion}";
    };
    it.maven(_function_1);
  };
  return ObjectExtensions.<ExternalDependency>operator_doubleArrow(_externalDependency, _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:14,代码来源:ExternalDependency.java

示例13: main

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
public static void main(final String[] args) {
  InetSocketAddress _inetSocketAddress = new InetSocketAddress("localhost", 8080);
  final Server server = new Server(_inetSocketAddress);
  WebAppContext _webAppContext = new WebAppContext();
  final Procedure1<WebAppContext> _function = (WebAppContext it) -> {
    it.setResourceBase("WebRoot");
    it.setWelcomeFiles(new String[] { "index.html" });
    it.setContextPath("/");
    AnnotationConfiguration _annotationConfiguration = new AnnotationConfiguration();
    WebXmlConfiguration _webXmlConfiguration = new WebXmlConfiguration();
    WebInfConfiguration _webInfConfiguration = new WebInfConfiguration();
    MetaInfConfiguration _metaInfConfiguration = new MetaInfConfiguration();
    it.setConfigurations(new Configuration[] { _annotationConfiguration, _webXmlConfiguration, _webInfConfiguration, _metaInfConfiguration });
    it.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN, ".*/com\\.hribol\\.bromium\\.dsl\\.web/.*,.*\\.jar");
    it.setInitParameter("org.mortbay.jetty.servlet.Default.useFileMappedBuffer", "false");
  };
  WebAppContext _doubleArrow = ObjectExtensions.<WebAppContext>operator_doubleArrow(_webAppContext, _function);
  server.setHandler(_doubleArrow);
  String _name = ServerLauncher.class.getName();
  final Slf4jLog log = new Slf4jLog(_name);
  try {
    server.start();
    URI _uRI = server.getURI();
    String _plus = ("Server started " + _uRI);
    String _plus_1 = (_plus + "...");
    log.info(_plus_1);
    final Runnable _function_1 = () -> {
      try {
        log.info("Press enter to stop the server...");
        final int key = System.in.read();
        if ((key != (-1))) {
          server.stop();
        } else {
          log.warn("Console input is not available. In order to stop the server, you need to cancel process manually.");
        }
      } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
      }
    };
    new Thread(_function_1).start();
    server.join();
  } catch (final Throwable _t) {
    if (_t instanceof Exception) {
      final Exception exception = (Exception)_t;
      log.warn(exception.getMessage());
      System.exit(1);
    } else {
      throw Exceptions.sneakyThrow(_t);
    }
  }
}
 
开发者ID:hristo-vrigazov,项目名称:bromium,代码行数:52,代码来源:ServerLauncher.java

示例14: main

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
public static void main(final String[] args) {
  InetSocketAddress _inetSocketAddress = new InetSocketAddress("localhost", 8080);
  final Server server = new Server(_inetSocketAddress);
  WebAppContext _webAppContext = new WebAppContext();
  final Procedure1<WebAppContext> _function = (WebAppContext it) -> {
    it.setResourceBase("WebRoot");
    it.setWelcomeFiles(new String[] { "index.html" });
    it.setContextPath("/");
    AnnotationConfiguration _annotationConfiguration = new AnnotationConfiguration();
    WebXmlConfiguration _webXmlConfiguration = new WebXmlConfiguration();
    WebInfConfiguration _webInfConfiguration = new WebInfConfiguration();
    MetaInfConfiguration _metaInfConfiguration = new MetaInfConfiguration();
    it.setConfigurations(new Configuration[] { _annotationConfiguration, _webXmlConfiguration, _webInfConfiguration, _metaInfConfiguration });
    it.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN, ".*/org\\.xtext\\.dsl\\.restaurante\\.web/.*,.*\\.jar");
    it.setInitParameter("org.mortbay.jetty.servlet.Default.useFileMappedBuffer", "false");
  };
  WebAppContext _doubleArrow = ObjectExtensions.<WebAppContext>operator_doubleArrow(_webAppContext, _function);
  server.setHandler(_doubleArrow);
  String _name = ServerLauncher.class.getName();
  final Slf4jLog log = new Slf4jLog(_name);
  try {
    server.start();
    URI _uRI = server.getURI();
    String _plus = ("Server started " + _uRI);
    String _plus_1 = (_plus + "...");
    log.info(_plus_1);
    final Runnable _function_1 = () -> {
      try {
        log.info("Press enter to stop the server...");
        final int key = System.in.read();
        if ((key != (-1))) {
          server.stop();
        } else {
          log.warn("Console input is not available. In order to stop the server, you need to cancel process manually.");
        }
      } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
      }
    };
    new Thread(_function_1).start();
    server.join();
  } catch (final Throwable _t) {
    if (_t instanceof Exception) {
      final Exception exception = (Exception)_t;
      log.warn(exception.getMessage());
      System.exit(1);
    } else {
      throw Exceptions.sneakyThrow(_t);
    }
  }
}
 
开发者ID:vicegd,项目名称:org.xtext.dsl.restaurante,代码行数:52,代码来源:ServerLauncher.java

示例15: testInsertBeforeComment

import org.eclipse.xtext.xbase.lib.ObjectExtensions; //导入方法依赖的package包/类
@Test
public void testInsertBeforeComment() {
  final InMemoryURIHandler fs = new InMemoryURIHandler();
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("#1 root {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("/**/ ");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("child1;");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  Pair<String, String> _mappedTo = Pair.<String, String>of("inmemory:/file1.pstl", _builder.toString());
  this._changeSerializerTestHelper.operator_add(fs, _mappedTo);
  final ResourceSet rs = this._changeSerializerTestHelper.createResourceSet(fs);
  final Node model = this._changeSerializerTestHelper.<Node>contents(rs, "inmemory:/file1.pstl", Node.class);
  final IChangeSerializer serializer = this._changeSerializerTestHelper.newChangeSerializer();
  final IChangeSerializer.IModification<Resource> _function = (Resource it) -> {
    EList<Node> _children = model.getChildren();
    Node _createNode = this.fac.createNode();
    final Procedure1<Node> _function_1 = (Node it_1) -> {
      it_1.setName("bazz");
    };
    Node _doubleArrow = ObjectExtensions.<Node>operator_doubleArrow(_createNode, _function_1);
    _children.add(0, _doubleArrow);
  };
  serializer.<Resource>addModification(model.eResource(), _function);
  Collection<IEmfResourceChange> _endRecordChangesToTextDocuments = this._changeSerializerTestHelper.endRecordChangesToTextDocuments(serializer);
  StringConcatenation _builder_1 = new StringConcatenation();
  _builder_1.append("----------------- inmemory:/file1.pstl (syntax: <offset|text>) -----------------");
  _builder_1.newLine();
  _builder_1.append("#1 root {<9:9| bazz; /**/ >child1;");
  _builder_1.newLine();
  _builder_1.append("}");
  _builder_1.newLine();
  _builder_1.append("--------------------------------------------------------------------------------");
  _builder_1.newLine();
  _builder_1.append("9 9 \"\\n\t/**/ \\n\t\" -> \" bazz; /**/ \"");
  _builder_1.newLine();
  this._changeSerializerTestHelper.operator_tripleEquals(_endRecordChangesToTextDocuments, _builder_1);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:44,代码来源:ChangeSerializerTest.java


注:本文中的org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。