com.google.protobuf.Parser.parsePartialFrom()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(575)

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

Parser.parsePartialFrom介绍

[英]Like #parseFrom(ByteString), but does not throw an exception if the message is missing required fields. Instead, a partial message is returned.
[中]比如#parseFrom(ByteString),但如果消息缺少必填字段,则不会引发异常。相反,会返回部分消息。

代码示例

代码示例来源:origin: apache/incubator-shardingsphere

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 authpb.Auth.Permission parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (authpb.Auth.Permission) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}

代码示例来源:origin: alibaba/canal

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 Header parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (Header) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: alibaba/canal

@java.lang.Override
public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.HeartBeat) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}

代码示例来源:origin: alibaba/canal

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 Entry parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (Entry) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: alibaba/canal

@java.lang.Override
public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientRollback) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}

代码示例来源:origin: alibaba/canal

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 Column parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (Column) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: alibaba/canal

@java.lang.Override
public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 com.alibaba.otter.canal.protocol.CanalPacket.Sub parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Sub) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}

代码示例来源:origin: alibaba/canal

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 RowChange parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (RowChange) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: apache/incubator-shardingsphere

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 mvccpb.Kv.KeyValue parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (mvccpb.Kv.KeyValue) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}

代码示例来源:origin: alibaba/canal

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 TransactionEnd parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (TransactionEnd) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: apache/incubator-shardingsphere

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 mvccpb.Kv.Event parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (mvccpb.Kv.Event) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}

代码示例来源:origin: alibaba/canal

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 Pair parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (Pair) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: alibaba/canal

@java.lang.Override
public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 com.alibaba.otter.canal.protocol.CanalPacket.ClientAck parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAck) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}

代码示例来源:origin: alibaba/canal

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 RowData parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (RowData) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: alibaba/canal

@java.lang.Override
public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 com.alibaba.otter.canal.protocol.CanalPacket.Unsub parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.Unsub) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}

代码示例来源:origin: alibaba/canal

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 TransactionBegin parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (TransactionBegin) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: alibaba/canal

@java.lang.Override
public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (com.alibaba.otter.canal.protocol.CanalPacket.ClientAuth) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int netReadTimeoutPresentCase_ = 0;

代码示例来源:origin: stanfordnlp/CoreNLP

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 edu.stanford.nlp.loglinear.model.proto.GraphicalModelProto.MetaData parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (edu.stanford.nlp.loglinear.model.proto.GraphicalModelProto.MetaData) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: apache/incubator-shardingsphere

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 authpb.Auth.User parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (authpb.Auth.User) e.getUnfinishedMessage();
  throw e.unwrapIOException();
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

代码示例来源:origin: stanfordnlp/CoreNLP

public Builder mergeFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 edu.stanford.nlp.loglinear.model.proto.GraphicalModelProto.Factor parsedMessage = null;
 try {
  parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  parsedMessage = (edu.stanford.nlp.loglinear.model.proto.GraphicalModelProto.Factor) e.getUnfinishedMessage();
  throw e;
 } finally {
  if (parsedMessage != null) {
   mergeFrom(parsedMessage);
  }
 }
 return this;
}
private int bitField0_;

相关文章