Package com.google.protobuf.DescriptorProtos

Examples of com.google.protobuf.DescriptorProtos.FileDescriptorSet


  private Descriptor getDescriptor(String descriptorFileInClassPath)
  {
    try {
      InputStream fin = this.getClass().getClassLoader().getResourceAsStream(descriptorFileInClassPath);
      FileDescriptorSet set = FileDescriptorSet.parseFrom(fin);
      FileDescriptor file = FileDescriptor.buildFrom(
          set.getFile(0), new FileDescriptor[]
          {}
      );
      return file.getMessageTypes().get(0);
    }
    catch (Exception e) {
View Full Code Here


                .getExtension(CustomOptions.GroupOptions.fdbsql).getVersion();
            if (storedVersion == currentVersion) {
                return fileProto;
            }
        }
        FileDescriptorSet set = null;
        if (fileProto != null) {
            FileDescriptorSet.Builder builder = FileDescriptorSet.newBuilder();
            builder.addFile(fileProto);
            set = builder.build();
        }
        AISToProtobuf ais2p = new AISToProtobuf(formatType, set);
        ais2p.addGroup(group);
        set = ais2p.build();
        fileProto = set.getFile(0); // Only added one group.
        // Make sure it will build before committing to this format.
        try {
            FileDescriptor.buildFrom(fileProto, DEPENDENCIES);
        }
        catch (DescriptorValidationException ex) {
View Full Code Here

    }

    protected ProtobufRowDataConverter converter(Group g) throws Exception {
        AISToProtobuf a2p = new AISToProtobuf(ProtobufRowFormat.Type.GROUP_MESSAGE);
        a2p.addGroup(g);
        FileDescriptorSet set = a2p.build();
        if (false) {
            new ProtobufDecompiler((Appendable)System.out).decompile(set);
        }
        FileDescriptor gdesc = FileDescriptor.buildFrom(set.getFile(0),
                                                        ProtobufStorageDescriptionHelper.DEPENDENCIES);
        return ProtobufRowDataConverter.forGroup(g, gdesc);
    }
View Full Code Here

        this.files = files;
    }
   
    @Test
    public void testAIS() throws Exception {
        FileDescriptorSet set = null;
        for (File file : files) {
            String sql = fileContents(file);
            runDDL(sql);
            AISToProtobuf ais2p = new AISToProtobuf(ProtobufRowFormat.Type.GROUP_MESSAGE, set);
            for (Group group : ais().getGroups().values()) {
View Full Code Here

        this.output = new BufferedWriter(new OutputStreamWriter(output));
    }

    public static void main(String[] args) throws IOException {
        ProtobufDecompiler decompiler = new ProtobufDecompiler((Appendable)System.out);
        FileDescriptorSet set;
        try (FileInputStream istr = new FileInputStream(args[0])) {
            set = FileDescriptorSet.parseFrom(istr);
        }
        decompiler.decompile(set);
    }
View Full Code Here

TOP

Related Classes of com.google.protobuf.DescriptorProtos.FileDescriptorSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.