當前位置: 首頁>>代碼示例>>Java>>正文


Java NotificationMessage.setMethod方法代碼示例

本文整理匯總了Java中org.eclipse.lsp4j.jsonrpc.messages.NotificationMessage.setMethod方法的典型用法代碼示例。如果您正苦於以下問題:Java NotificationMessage.setMethod方法的具體用法?Java NotificationMessage.setMethod怎麽用?Java NotificationMessage.setMethod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.lsp4j.jsonrpc.messages.NotificationMessage的用法示例。


在下文中一共展示了NotificationMessage.setMethod方法的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.setMethod方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。