Message from discussion
How to dynamically parse protobuf with extension messages
Received: by 10.52.240.204 with SMTP id wc12mr1300864vdc.2.1318373971413;
Tue, 11 Oct 2011 15:59:31 -0700 (PDT)
X-BeenThere: protobuf@googlegroups.com
Received: by 10.221.13.132 with SMTP id pm4ls5873672vcb.5.canary; Tue, 11 Oct
2011 15:59:29 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.186.1 with SMTP id cq1mr708737vcb.49.1318373969238; Tue,
11 Oct 2011 15:59:29 -0700 (PDT)
Received: by d26g2000vby.googlegroups.com with HTTP; Tue, 11 Oct 2011 15:59:29
-0700 (PDT)
Date: Tue, 11 Oct 2011 15:59:29 -0700 (PDT)
In-Reply-To: <fd922857-476f-4d8f-b85e-45a64dee5b7e@z19g2000vby.googlegroups.com>
References: <ac0cf93b-e4f1-4a2a-a724-a60a7f9cd188@r8g2000prh.googlegroups.com>
<cacd0807-0aa1-42e9-a1da-34716fbdcb6e@de2g2000vbb.googlegroups.com> <fd922857-476f-4d8f-b85e-45a64dee5b7e@z19g2000vby.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1,gzip(gfe)
Message-ID: <7ff10aee-a22f-4c9e-b81a-ceec49e27073@d26g2000vby.googlegroups.com>
Subject: Re: How to dynamically parse protobuf with extension messages
From: Benjamin Wright <compuware...@gmail.com>
To: Protocol Buffers <protobuf@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
In that case I recommend you browse through my recent discussion with
Dale Durham as I walked him through the process of using the
FileDescriptorSet's that are created when you compile using the --
descriptor_set_out flag to protoc or can obtain from another runtime
that has access to compiled protocol buffer files.
http://groups.google.com/group/protobuf/t/611309b44201a747
The only difference is that you need to register each extension
manually with the ExtensionRegistry as no "registerAllExtensions"
method is available.
You can register extensions manually from a FileDescriptor as such:
FileDescriptor fileDescriptor;
ExtensionRegistry extensionRegistry =3D
ExtensionRegistry.newInstance();
for(FieldDescriptor extension : fileDescriptor.getExtensions()) {
extensionRegistry.add(extension);
}
On Oct 11, 6:33=A0pm, prem <mpremj...@gmail.com> wrote:
> Thanks for the info. this solution requires the Class MyMesage be
> present on the receiving side.
> I was trying to just use the description-out file created by the