下面列出了怎么用com.google.protobuf.DescriptorProtos.OneofDescriptorProto的API类实例代码及写法,或者点击链接到github查看源代码。
private OneofDescriptor(final OneofDescriptorProto proto,
final FileDescriptor file,
final Descriptor parent,
final int index)
throws DescriptorValidationException {
this.proto = proto;
fullName = computeFullName(file, parent, proto.getName());
this.file = file;
this.index = index;
containingType = parent;
fieldCount = 0;
}
public static Oneof create(ProtoContainerElement parent, OneofDescriptorProto proto,
String path) {
return new Oneof(parent, proto, path);
}
private Oneof(ProtoContainerElement parent, OneofDescriptorProto proto, String path) {
super(parent, proto.getName(), path);
this.proto = proto;
}
private void setProto(final OneofDescriptorProto proto) {
this.proto = proto;
}
public OneofBuilder addOneof(String oneofName) {
mMsgTypeBuilder.addOneofDecl(OneofDescriptorProto.newBuilder().setName(oneofName).build());
return new OneofBuilder(this, mOneofIndex++);
}