Home
last modified time | relevance | path

Searched refs:fieldDescriptor (Results 1 – 25 of 25) sorted by relevance

/third_party/protobuf/ruby/src/main/java/com/google/protobuf/jruby/
DRubyMessage.java87 final Descriptors.FieldDescriptor fieldDescriptor = findField(context, key); in initialize()
91 if (Utils.isMapEntry(fieldDescriptor)) { in initialize()
95 final RubyMap map = newMapForField(context, fieldDescriptor); in initialize()
97 maps.put(fieldDescriptor, map); in initialize()
98 } else if (fieldDescriptor.isRepeated()) { in initialize()
101 … RubyRepeatedField repeatedField = rubyToRepeatedField(context, fieldDescriptor, value); in initialize()
102 addRepeatedField(fieldDescriptor, repeatedField); in initialize()
104 Descriptors.OneofDescriptor oneof = fieldDescriptor.getContainingOneof(); in initialize()
106 oneofCases.put(oneof, fieldDescriptor); in initialize()
109 …if (value instanceof RubyHash && fieldDescriptor.getType() == Descriptors.FieldDescriptor.Type.MES… in initialize()
[all …]
DRubyDescriptorPool.java140 for (Descriptors.FieldDescriptor fieldDescriptor : descriptor.getFields()) { in buildFileDescriptor()
141 if (fieldDescriptor.isRequired()) { in buildFileDescriptor()
144 … RubyFieldDescriptor rubyFieldDescriptor = rubyDescriptor.lookup(fieldDescriptor.getName()); in buildFileDescriptor()
145 rubyFieldDescriptor.setFieldDef(fieldDescriptor); in buildFileDescriptor()
146 if (fieldDescriptor.getType() == Descriptors.FieldDescriptor.Type.MESSAGE) { in buildFileDescriptor()
148 … runtime.newString(Utils.unescapeIdentifier(fieldDescriptor.getMessageType().getName()))); in buildFileDescriptor()
151 if (fieldDescriptor.getType() == Descriptors.FieldDescriptor.Type.ENUM) { in buildFileDescriptor()
153 … runtime.newString(Utils.unescapeIdentifier(fieldDescriptor.getEnumType().getName()))); in buildFileDescriptor()
DRubyOneofDescriptor.java85 RubyFieldDescriptor fieldDescriptor = (RubyFieldDescriptor) obj; in addField() local
86 fieldDescriptor.setOneofName(this.name); in addField()
87 fields.add(fieldDescriptor); in addField()
117 RubyFieldDescriptor fieldDescriptor = fields.get(0); in getOneofDescriptor() local
118 return fieldDescriptor.getFieldDef().getContainingOneof(); in getOneofDescriptor()
DRubyOneofBuilderContext.java76 RubyFieldDescriptor fieldDescriptor = Utils.msgdefCreateField(context, "optional", in optional() local
78 descriptor.addField(context, fieldDescriptor); in optional()
DUtils.java230 public static boolean isMapEntry(Descriptors.FieldDescriptor fieldDescriptor) { in isMapEntry() argument
231 return fieldDescriptor.getType() == Descriptors.FieldDescriptor.Type.MESSAGE && in isMapEntry()
232 fieldDescriptor.isRepeated() && in isMapEntry()
233 fieldDescriptor.getMessageType().getOptions().getMapEntry(); in isMapEntry()
DRubyFieldDescriptor.java241 protected void setFieldDef(Descriptors.FieldDescriptor fieldDescriptor) { in setFieldDef() argument
242 this.fieldDef = fieldDescriptor; in setFieldDef()
DRubyDescriptor.java183 for (RubyFieldDescriptor fieldDescriptor : def.getFields()) { in addOneof()
184 addField(context, fieldDescriptor); in addOneof()
/third_party/protobuf/java/core/src/main/java/com/google/protobuf/
DTextFormatParseInfoTree.java97 public List<TextFormatParseLocation> getLocations(final FieldDescriptor fieldDescriptor) { in getLocations() argument
98 List<TextFormatParseLocation> result = locationsFromField.get(fieldDescriptor); in getLocations()
113 public TextFormatParseLocation getLocation(final FieldDescriptor fieldDescriptor, int index) { in getLocation() argument
114 return getFromList(getLocations(fieldDescriptor), index, fieldDescriptor); in getLocation()
123 public List<TextFormatParseInfoTree> getNestedTrees(final FieldDescriptor fieldDescriptor) { in getNestedTrees() argument
124 List<TextFormatParseInfoTree> result = subtreesFromField.get(fieldDescriptor); in getNestedTrees()
137 public TextFormatParseInfoTree getNestedTree(final FieldDescriptor fieldDescriptor, int index) { in getNestedTree() argument
138 return getFromList(getNestedTrees(fieldDescriptor), index, fieldDescriptor); in getNestedTree()
150 private static <T> T getFromList(List<T> list, int index, FieldDescriptor fieldDescriptor) { in getFromList() argument
155 fieldDescriptor == null ? "<null>" : fieldDescriptor.getName(), index)); in getFromList()
[all …]
DGeneratedMessageV3.java2070 fieldDescriptor = oneofDescriptor.getFields().get(0);
2074 fieldDescriptor = null;
2083 private final FieldDescriptor fieldDescriptor;
2086 if (fieldDescriptor != null) {
2087 return message.hasField(fieldDescriptor);
2097 if (fieldDescriptor != null) {
2098 return builder.hasField(fieldDescriptor);
2108 if (fieldDescriptor != null) {
2109 return message.hasField(fieldDescriptor) ? fieldDescriptor : null;
2120 if (fieldDescriptor != null) {
[all …]
DTextFormat.java458 public MapEntryAdapter(Object entry, FieldDescriptor fieldDescriptor) { in MapEntryAdapter() argument
464 this.fieldType = extractFieldType(fieldDescriptor); in MapEntryAdapter()
467 private static FieldDescriptor.JavaType extractFieldType(FieldDescriptor fieldDescriptor) { in extractFieldType() argument
468 return fieldDescriptor.getMessageType().getFields().get(0).getJavaType(); in extractFieldType()
/third_party/protobuf/java/core/src/test/java/com/google/protobuf/
DFieldPresenceTest.java143 FieldDescriptor fieldDescriptor = TestProto3Optional.getDescriptor().findFieldByName(name); in assertProto3OptionalReflection() local
144 OneofDescriptor oneofDescriptor = fieldDescriptor.getContainingOneof(); in assertProto3OptionalReflection()
145 assertNotNull(fieldDescriptor.getContainingOneof()); in assertProto3OptionalReflection()
146 assertTrue(fieldDescriptor.hasOptionalKeyword()); in assertProto3OptionalReflection()
147 assertTrue(fieldDescriptor.hasPresence()); in assertProto3OptionalReflection()
153 builder.setField(fieldDescriptor, fieldDescriptor.getDefaultValue()); in assertProto3OptionalReflection()
154 assertTrue(builder.hasField(fieldDescriptor)); in assertProto3OptionalReflection()
155 assertEquals(fieldDescriptor.getDefaultValue(), builder.getField(fieldDescriptor)); in assertProto3OptionalReflection()
156 assertTrue(builder.build().hasField(fieldDescriptor)); in assertProto3OptionalReflection()
157 assertEquals(fieldDescriptor.getDefaultValue(), builder.build().getField(fieldDescriptor)); in assertProto3OptionalReflection()
[all …]
DGeneratedMessageTest.java1233 FieldDescriptor fieldDescriptor = descriptor.findFieldByName("optional_nested_message"); in testGetFieldBuilder() local
1242 .newBuilderForField(fieldDescriptor) in testGetFieldBuilder()
1243 .mergeFrom((Message) builder1.getField(fieldDescriptor)); in testGetFieldBuilder()
1247 builder1.setField(fieldDescriptor, fieldBuilder1.build()); in testGetFieldBuilder()
1274 Message.Builder fieldBuilder2 = builder2.getFieldBuilder(fieldDescriptor); in testGetFieldBuilder()
1278 builder2.setField(fieldDescriptor, fieldBuilder2.build()); in testGetFieldBuilder()
1308 FieldDescriptor fieldDescriptor = descriptor.findFieldByName("optional_nested_message"); in testGetFieldBuilderWithInitializedValue() local
1313 (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor); in testGetFieldBuilderWithInitializedValue()
1321 fieldBuilder = (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor); in testGetFieldBuilderWithInitializedValue()
1669 FieldDescriptor fieldDescriptor = descriptor.findFieldByName("repeated_nested_message"); in testGetRepeatedFieldBuilder() local
[all …]
DMapTest.java1375 FieldDescriptor fieldDescriptor = in testInitFromPartialDynamicMessage() local
1377 Descriptor mapEntryType = fieldDescriptor.getMessageType(); in testInitFromPartialDynamicMessage()
1383 fieldDescriptor, in testInitFromPartialDynamicMessage()
1396 FieldDescriptor fieldDescriptor = in testInitFromFullyDynamicMessage() local
1398 Descriptor mapEntryType = fieldDescriptor.getMessageType(); in testInitFromFullyDynamicMessage()
1404 fieldDescriptor, in testInitFromFullyDynamicMessage()
/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/
DMessageDescriptor.cs390 var fieldDescriptor = messageDescriptor.FindFieldByNumber(number);
391 if (fieldDescriptor == null)
395 return fieldDescriptor;
410 var fieldDescriptor = messageDescriptor.FindFieldByName(name);
411 if (fieldDescriptor == null)
415 return fieldDescriptor;
/third_party/protobuf/csharp/src/Google.Protobuf.Test/Reflection/
DCustomOptionsTest.cs137 var fieldDescriptor = TestMessageWithCustomOptions.Descriptor.Fields["field1"]; in OptionLocations()
138 …AssertOption(8765432109UL, fieldDescriptor.CustomOptions.TryGetFixed64, FieldOpt1, fieldDescriptor in OptionLocations()
200 var fieldDescriptor = messageDescriptor.Fields["fieldname"]; in AggregateOptions()
201 … { S = "FieldAnnotation" }, fieldDescriptor.CustomOptions.TryGetMessage, Fieldopt, fieldDescriptor in AggregateOptions()
/third_party/protobuf/objectivec/Tests/
DGPBDescriptorTests.m289 GPBFieldDescriptor *fieldDescriptor =
293 XCTAssertTrue([fieldDescriptor isValidEnumValue:1]);
294 XCTAssertTrue([fieldDescriptor isValidEnumValue:2]);
295 XCTAssertTrue([fieldDescriptor isValidEnumValue:3]);
296 XCTAssertTrue([fieldDescriptor isValidEnumValue:-1]);
299 XCTAssertFalse([fieldDescriptor isValidEnumValue:4]);
300 XCTAssertFalse([fieldDescriptor isValidEnumValue:0]);
301 XCTAssertFalse([fieldDescriptor isValidEnumValue:-2]);
DGPBMessageTests.m470 GPBFieldDescriptor *fieldDescriptor =
472 XCTAssertNotNil(fieldDescriptor);
473 GPBGenericValue defaultValue = [fieldDescriptor defaultValue];
480 fieldDescriptor = [descriptor fieldWithName:@"defaultString"];
481 XCTAssertNotNil(fieldDescriptor);
482 defaultValue = [fieldDescriptor defaultValue];
491 fieldDescriptor = [descriptor fieldWithName:@"defaultString"];
492 XCTAssertNotNil(fieldDescriptor);
493 defaultValue = [fieldDescriptor defaultValue];
508 fieldDescriptor = [descriptor fieldWithName:@"defaultBytes"];
[all …]
DGPBMessageTests+Runtime.m2720 GPBFieldDescriptor *fieldDescriptor = [[message descriptor] fieldWithName:@"repeatedStringArray"];
2721 XCTAssertNotNil(fieldDescriptor);
2722 NSMutableArray *fieldArray = GPBGetMessageRepeatedField(message, fieldDescriptor);
2729 GPBFieldDescriptor *fieldDescriptor = [[message descriptor] fieldWithName:@"repeatedStringArray"];
2730 XCTAssertNotNil(fieldDescriptor);
2733 GPBSetMessageRepeatedField(message, fieldDescriptor, fieldArray);
2740 GPBFieldDescriptor *fieldDescriptor = [[message descriptor] fieldWithName:@"mapStringString"];
2741 XCTAssertNotNil(fieldDescriptor);
2742 NSMutableDictionary *fieldMap = GPBGetMessageMapField(message, fieldDescriptor);
2749 GPBFieldDescriptor *fieldDescriptor = [[message descriptor] fieldWithName:@"mapStringString"];
[all …]
/third_party/protobuf/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/
DGeneratedMessageTest.java829 FieldDescriptor fieldDescriptor = in testGetFieldBuilder() local
839 Message.Builder fieldBuilder1 = builder1.newBuilderForField(fieldDescriptor) in testGetFieldBuilder()
840 .mergeFrom((Message) builder1.getField(fieldDescriptor)); in testGetFieldBuilder()
844 builder1.setField(fieldDescriptor, fieldBuilder1.build()); in testGetFieldBuilder()
869 Message.Builder fieldBuilder2 = builder2.getFieldBuilder(fieldDescriptor); in testGetFieldBuilder()
873 builder2.setField(fieldDescriptor, fieldBuilder2.build()); in testGetFieldBuilder()
901 FieldDescriptor fieldDescriptor = in testGetFieldBuilderWithInitializedValue() local
907 (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor); in testGetFieldBuilderWithInitializedValue()
917 (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor); in testGetFieldBuilderWithInitializedValue()
/third_party/protobuf/src/google/protobuf/compiler/csharp/
Dcsharp_message.cc211 const FieldDescriptor* fieldDescriptor = descriptor_->field(i); in Generate() local
217 "field_name", fieldDescriptor->name(), in Generate()
218 "field_constant_name", GetFieldConstantName(fieldDescriptor), in Generate()
219 "index", StrCat(fieldDescriptor->number())); in Generate()
221 CreateFieldGeneratorInternal(fieldDescriptor)); in Generate()
/third_party/protobuf/src/google/protobuf/compiler/objectivec/
Dobjectivec_message.cc223 const FieldDescriptor* fieldDescriptor = descriptor_->field(i); in DetermineForwardDeclarations() local
224 field_generators_.get(fieldDescriptor) in DetermineForwardDeclarations()
237 const FieldDescriptor* fieldDescriptor = descriptor_->field(i); in DetermineObjectiveCClassDefinitions() local
238 field_generators_.get(fieldDescriptor) in DetermineObjectiveCClassDefinitions()
Dobjectivec_helpers.cc565 const Descriptor* fieldDescriptor = descriptor->containing_type(); in OneofEnumName() local
566 string name = ClassName(fieldDescriptor); in OneofEnumName()
/third_party/protobuf/objectivec/
DGPBMessage.m2365 GPBFieldDescriptor *fieldDescriptor = fields[startingIndex];
2366 if (GPBFieldTag(fieldDescriptor) == tag) {
2367 GPBFieldType fieldType = fieldDescriptor.fieldType;
2369 MergeSingleFieldFromCodedInputStream(self, fieldDescriptor, syntax,
2375 if (fieldDescriptor.isPackable) {
2377 self, fieldDescriptor, syntax, input);
2383 self, fieldDescriptor, syntax, input, extensionRegistry);
2388 id map = GetOrCreateMapIvarWithField(self, fieldDescriptor);
2391 field:fieldDescriptor
2407 GPBFieldDescriptor *fieldDescriptor = fields[startingIndex];
[all …]
DGPBDescriptor.m147 GPBFieldDescriptor *fieldDescriptor =
153 [fields addObject:fieldDescriptor];
154 [fieldDescriptor release];
211 for (GPBFieldDescriptor *fieldDescriptor in fields_) {
212 if (fieldDescriptor->description_->flags & GPBFieldTextFormatNameCustom) {
213 objc_setAssociatedObject(fieldDescriptor, &kTextFormatExtraValueKey,
/third_party/protobuf/csharp/src/Google.Protobuf.Test/
DFieldMaskTreeTest.cs175 foreach (var fieldDescriptor in destination.Descriptor.Fields.InFieldNumberOrder()) in Merge()
177 fieldDescriptor.Accessor.Clear(destination); in Merge()