Examples of

        new CachedDescriptorRetriever() {
          protected FieldDescriptor loadDescriptor() {
            try {
              Class clazz =
              FileDescriptor file =
                  (FileDescriptor) clazz.getField("descriptor").get(null);
              return file.findExtensionByName(extensionName);
            } catch (Exception e) {
              throw new RuntimeException(
                  "Cannot load descriptors: " + descriptorOuterClass +
                  " is not a valid descriptor class name", e);
View Full Code Here


    static ProtobufRowDataConverter buildConverter(HasStorage object,
                                                   FileDescriptorProto fileProto) {
        Group group = (Group)object;
        FileDescriptor fileDescriptor;
        try {
            fileDescriptor = FileDescriptor.buildFrom(fileProto, DEPENDENCIES);
        catch (DescriptorValidationException ex) {
            throw new ProtobufBuildException(ex);
View Full Code Here

        FileDescriptorSet set =;
        if (false) {
            new ProtobufDecompiler((Appendable)System.out).decompile(set);
        FileDescriptor gdesc = FileDescriptor.buildFrom(set.getFile(0),
        return ProtobufRowDataConverter.forGroup(g, gdesc);
View Full Code Here

  public void testGetFileDescriptor() throws DescriptorValidationException {
    ThriftToDynamicProto<Person> converter = new ThriftToDynamicProto<Person>(Person.class);
    Person person = genPerson();
    Message msg = converter.convert(person);

    FileDescriptor expectedFd = msg.getDescriptorForType().getFile();
    FileDescriptor actualFd = converter.getFileDescriptor();

    assertEquals(expectedFd, actualFd);
View Full Code Here


Related Classes of

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