Examples of MessageField


Examples of com.google.eclipse.protobuf.protobuf.MessageField

    }
  }

  private boolean canBePacked(IndexedElement e) {
    if (e instanceof MessageField) {
      MessageField field = (MessageField) e;
      return messageFields.isPrimitive(field) && REPEATED.equals(field.getModifier());
    }
    return false;
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

  //
  // message Person {
  //   optional string name = 1;
  // }
  @Test public void should_not_include_package_name_as_part_of_field_FQN_if_package_is_not_specified() {
    MessageField field = xtext.find("name", MessageField.class);
    QualifiedName fqn = provider.getFullyQualifiedName(field);
    assertThat(fqn.toString(), equalTo("Person.name"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

  //
  // message Person {
  //   optional string name = 1;
  // }
  @Test public void should_return_root_of_proto() {
    MessageField field = xtext.find("name", MessageField.class);
    assertThat(modelObjects.rootOf(field), sameInstance(xtext.root()));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

    return null;
  }

  @Override public void completeDefaultValueFieldOption_Value(EObject model, Assignment assignment,
      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    MessageField field = null;
    if (model instanceof DefaultValueFieldOption) {
      field = (MessageField) model.eContainer();
    }
    if (model instanceof MessageField) {
      field = (MessageField) model;
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

  @Override public void completeNativeFieldOption_Value(EObject model, Assignment assignment,
      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    if (model instanceof NativeFieldOption) {
      NativeFieldOption option = (NativeFieldOption) model;
      ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
      MessageField field = (MessageField) options.rootSourceOf(option);
      Enum enumType = descriptor.enumTypeOf(field);
      if (enumType != null) {
        proposeAndAccept(enumType, context, acceptor);
        return;
      }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

  //
  // message PhoneNumber {
  //   optional PhoneType type = 1;
  // }
  @Test public void should_return_enum_if_field_type_is_enum() {
    MessageField field = xtext.find("type", MessageField.class);
    Enum anEnum = fields.enumTypeOf(field);
    assertThat(anEnum.getName(), equalTo("PhoneType"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

  //
  // message Person {
  //   optional string name = 1;
  // }
  @Test public void should_return_null_if_field_type_is_not_enum() {
    MessageField field = xtext.find("name", MessageField.class);
    assertNull(fields.enumTypeOf(field));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

  //
  // message Person {
  //   optional String firstName = 1;
  // }
  @Test public void should_return_name_of_MessageField() {
    MessageField field = xtext.find("firstName", MessageField.class);
    String name = resolver.nameOf(field);
    assertThat(name, equalTo("firstName"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

  //
  // message Person {
  //   optional bool code = 1;
  // }
  @Test public void should_return_true_if_field_is_bool() {
    MessageField field = xtext.find("code", MessageField.class);
    assertTrue(fields.isBool(field));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.MessageField

  //
  // message Person {
  //   optional string name = 1;
  // }
  @Test public void should_return_false_if_property_is_not_bool() {
    MessageField field = xtext.find("name", MessageField.class);
    assertFalse(fields.isBool(field));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.