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


Java NotificationMessage.setParams方法代码示例

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


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

示例1: notify

import org.eclipse.lsp4j.jsonrpc.messages.NotificationMessage; //导入方法依赖的package包/类
@Override
public void notify(String method, Object parameter) {
	NotificationMessage notificationMessage = new NotificationMessage();
	notificationMessage.setJsonrpc(MessageConstants.JSONRPC_VERSION);
	notificationMessage.setMethod(method);
	notificationMessage.setParams(parameter);
	out.consume(notificationMessage);
}
 
开发者ID:smarr,项目名称:SOMns-vscode,代码行数:9,代码来源:RemoteEndpoint.java

示例2: testTelemetry

import org.eclipse.lsp4j.jsonrpc.messages.NotificationMessage; //导入方法依赖的package包/类
@Test
public void testTelemetry() {
  NotificationMessage _notificationMessage = new NotificationMessage();
  final Procedure1<NotificationMessage> _function = (NotificationMessage it) -> {
    it.setJsonrpc("2.0");
    it.setMethod(MessageMethods.TELEMETRY_EVENT);
    JsonSerializeTest.TestObject _testObject = new JsonSerializeTest.TestObject();
    it.setParams(_testObject);
  };
  final NotificationMessage message = ObjectExtensions.<NotificationMessage>operator_doubleArrow(_notificationMessage, _function);
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("{");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("\"jsonrpc\": \"2.0\",");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("\"method\": \"telemetry/event\",");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("\"params\": {");
  _builder.newLine();
  _builder.append("    ");
  _builder.append("\"foo\": 12.3,");
  _builder.newLine();
  _builder.append("    ");
  _builder.append("\"bar\": \"qwertz\"");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("}");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  this.assertSerialize(message, _builder);
}
 
开发者ID:eclipse,项目名称:lsp4j,代码行数:36,代码来源:JsonSerializeTest.java

示例3: testTelemetry

import org.eclipse.lsp4j.jsonrpc.messages.NotificationMessage; //导入方法依赖的package包/类
@Test
public void testTelemetry() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("{");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("\"jsonrpc\": \"2.0\",");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("\"method\": \"telemetry/event\",");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("\"params\": {");
  _builder.newLine();
  _builder.append("\t\t");
  _builder.append("\"foo\": 12.3,");
  _builder.newLine();
  _builder.append("\t\t");
  _builder.append("\"bar\": \"qwertz\"");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("}");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  NotificationMessage _notificationMessage = new NotificationMessage();
  final Procedure1<NotificationMessage> _function = (NotificationMessage it) -> {
    it.setJsonrpc("2.0");
    it.setMethod(MessageMethods.TELEMETRY_EVENT);
    Pair<String, Double> _mappedTo = Pair.<String, Double>of("foo", Double.valueOf(12.3));
    Pair<String, String> _mappedTo_1 = Pair.<String, String>of("bar", "qwertz");
    it.setParams(CollectionLiterals.<String, Object>newLinkedHashMap(_mappedTo, _mappedTo_1));
  };
  NotificationMessage _doubleArrow = ObjectExtensions.<NotificationMessage>operator_doubleArrow(_notificationMessage, _function);
  this.assertParse(_builder, _doubleArrow);
}
 
开发者ID:eclipse,项目名称:lsp4j,代码行数:37,代码来源:JsonParseTest.java

示例4: createNotificationMessage

import org.eclipse.lsp4j.jsonrpc.messages.NotificationMessage; //导入方法依赖的package包/类
protected NotificationMessage createNotificationMessage(String method, Object parameter) {
	NotificationMessage notificationMessage = new NotificationMessage();
	notificationMessage.setJsonrpc(MessageConstants.JSONRPC_VERSION);
	notificationMessage.setMethod(method);
	notificationMessage.setParams(parameter);
	return notificationMessage;
}
 
开发者ID:eclipse,项目名称:lsp4j,代码行数:8,代码来源:RemoteEndpoint.java


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