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; }
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; }
@Override public void exitOneofStatement(final OneofStatementContext ctx) { final OneofDescriptorProto.Builder oneofBuilder = OneofDescriptorProto.Builder.class.cast(scopes.getProtoBuilder()); oneofBuilder.setName(ctx.identifier().getText()); scopes.popScope(); scopes.verifyOneofName(oneofBuilder); }
public void verifyOneofName(final OneofDescriptorProto.Builder oneof) { if (currentScope instanceof MessageScope) { final MessageScope scope = (MessageScope) currentScope; if (!scope.verifyOneofNameUnique(oneof.getName())) { contextLookup.reportNonUniqueOneofNameError(oneof, false); } } }
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 OneofDescriptorProto.Builder addOneOf() { final OneofDescriptorProto.Builder builder = currentScope.addOneof(); pushScope(new OneofScope(builder, (MessageScope) currentScope)); return builder; }
protected OneofDescriptorProto.Builder addOneof() { throw new RuntimeException(NOT_APPLICABLE_IN_CURRENT_SCOPE); }
@Override protected OneofDescriptorProto.Builder addOneof() { return protoBuilder.addOneofDeclBuilder(); }
private OneofScope(final OneofDescriptorProto.Builder protoBuilder, final Scope<DescriptorProto.Builder> parent) { super(protoBuilder, parent); oneofIndex = parent.getProtoBuilder().getOneofDeclCount() - 1; }