@JRubyMethod(name = "label=")
public IRubyObject setLabel(ThreadContext context, IRubyObject value) {
String labelName = value.asJavaString();
this.label = context.runtime.newSymbol(labelName.toLowerCase());
this.builder.setLabel(
DescriptorProtos.FieldDescriptorProto.Label.valueOf("LABEL_" + labelName.toUpperCase()));
return context.runtime.getNil();
}
java类com.google.protobuf.DescriptorProtos的实例源码
RubyFieldDescriptor.java 文件源码
项目:bazel
阅读 30
收藏 0
点赞 0
评论 0
RubyDescriptorPool.java 文件源码
项目:bazel
阅读 25
收藏 0
点赞 0
评论 0
@JRubyMethod
public IRubyObject initialize(ThreadContext context) {
this.symtab = new HashMap<IRubyObject, IRubyObject>();
this.cBuilder = (RubyClass) context.runtime.getClassFromPath("Google::Protobuf::Builder");
this.builder = DescriptorProtos.FileDescriptorProto.newBuilder();
return this;
}
RubyDescriptor.java 文件源码
项目:bazel
阅读 21
收藏 0
点赞 0
评论 0
@JRubyMethod
public IRubyObject initialize(ThreadContext context) {
this.builder = DescriptorProtos.DescriptorProto.newBuilder();
this.fieldDefMap = new HashMap<String, RubyFieldDescriptor>();
this.oneofDefs = new HashMap<IRubyObject, RubyOneofDescriptor>();
return this;
}
TestObjectWritableProtos.java 文件源码
项目:hadoop-on-lustre2
阅读 23
收藏 0
点赞 0
评论 0
/**
* Write a protobuf to a buffer 'numProtos' times, and then
* read them back, making sure all data comes through correctly.
*/
private void doTest(int numProtos) throws IOException {
Configuration conf = new Configuration();
DataOutputBuffer out = new DataOutputBuffer();
// Write numProtos protobufs to the buffer
Message[] sent = new Message[numProtos];
for (int i = 0; i < numProtos; i++) {
// Construct a test protocol buffer using one of the
// protos that ships with the protobuf library
Message testProto = DescriptorProtos.EnumValueDescriptorProto.newBuilder()
.setName("test" + i).setNumber(i).build();
ObjectWritable.writeObject(out, testProto,
DescriptorProtos.EnumValueDescriptorProto.class, conf);
sent[i] = testProto;
}
// Read back the data
DataInputBuffer in = new DataInputBuffer();
in.reset(out.getData(), out.getLength());
for (int i = 0; i < numProtos; i++) {
Message received = (Message)ObjectWritable.readObject(in, conf);
assertEquals(sent[i], received);
}
}
DossierSoyModule.java 文件源码
项目:js-dossier
阅读 27
收藏 0
点赞 0
评论 0
@Provides
@Singleton
SoyProtoTypeProvider provideSoyTypeProvider()
throws IOException, Descriptors.DescriptorValidationException {
return new SoyProtoTypeProvider.Builder()
.addDescriptors(
collectDescriptors(
DescriptorProtos.getDescriptor(),
Dossier.getDescriptor(),
Expression.getDescriptor()))
.build();
}
TestRPC.java 文件源码
项目:hadoop
阅读 38
收藏 0
点赞 0
评论 0
DescriptorProtos.EnumDescriptorProto exchangeProto(
DescriptorProtos.EnumDescriptorProto arg);
TestRPC.java 文件源码
项目:aliyun-oss-hadoop-fs
阅读 31
收藏 0
点赞 0
评论 0
DescriptorProtos.EnumDescriptorProto exchangeProto(
DescriptorProtos.EnumDescriptorProto arg);
TestRPC.java 文件源码
项目:big-c
阅读 37
收藏 0
点赞 0
评论 0
DescriptorProtos.EnumDescriptorProto exchangeProto(
DescriptorProtos.EnumDescriptorProto arg);
ExtensionPool.java 文件源码
项目:api-compiler
阅读 34
收藏 0
点赞 0
评论 0
public DescriptorProtos.SourceCodeInfo.Location getLocation() {
return location;
}
TestPBOnWritableRpc.java 文件源码
项目:LCIndex-HBase-0.94.16
阅读 22
收藏 0
点赞 0
评论 0
DescriptorProtos.EnumDescriptorProto exchangeProto(
DescriptorProtos.EnumDescriptorProto arg);