Examples of FieldOption


Examples of com.google.eclipse.protobuf.protobuf.FieldOption

  //
  // message Person {
  //   optional boolean active = 1 [(encoding) = 'UTF-8'];
  // }
  @Test public void should_return_field_of_custom_field_option() {
    FieldOption option = xtext.find("encoding", ")", FieldOption.class);
    MessageField field = (MessageField) options.rootSourceOf(option);
    assertThat(field.getName(), equalTo("encoding"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.FieldOption

  @Fix(EXPECTED_BOOL_ERROR)
  public void changeValueToTrue(Issue issue, IssueResolutionAcceptor acceptor) {
    EObject element = elementIn(issue);
    if (element instanceof FieldOption) {
      FieldOption option = (FieldOption) element;
      changeValue(option, linkTo(TRUE), CommonKeyword.TRUE, issue, acceptor);
    }
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.FieldOption

  @Fix(EXPECTED_BOOL_ERROR)
  public void changeValueToFalse(Issue issue, IssueResolutionAcceptor acceptor) {
    EObject element = elementIn(issue);
    if (element instanceof FieldOption) {
      FieldOption option = (FieldOption) element;
      changeValue(option, linkTo(FALSE), CommonKeyword.FALSE, issue, acceptor);
    }
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.FieldOption

  @Fix(EXPECTED_STRING_ERROR)
  public void changeValueToEmptyString(Issue issue, IssueResolutionAcceptor acceptor) {
    EObject element = elementIn(issue);
    if (element instanceof FieldOption) {
      FieldOption option = (FieldOption) element;
      String valueToPropose = "";
      changeValue(option, linkTo(valueToPropose), valueToPropose, issue, acceptor);
    }
  }
View Full Code Here

Examples of org.msgpack.template.FieldOption

    @Override
    public <T> Template<T> buildTemplate(final Type targetType) throws TemplateBuildException {
  @SuppressWarnings("unchecked")
  Class<T> targetClass = (Class<T>) targetType;
  checkClassValidation(targetClass);
  FieldOption fieldOption = getFieldOption(targetClass);
  FieldEntry[] entries = toFieldEntries(targetClass, fieldOption);
  return buildTemplate(targetClass, entries);
    }
View Full Code Here

Examples of org.msgpack.template.FieldOption

   *             int field_f;   // 5
   */
  List<FieldEntry> indexed = new ArrayList<FieldEntry>();
  int maxIndex = -1;
  for (Field f : fields) {
      FieldOption opt = getFieldOption(f, from);
      if (opt == FieldOption.IGNORE) {
    // skip
    continue;
      }

View Full Code Here

Examples of org.msgpack.template.FieldOption

      }

  }
  for (int i = 0; i < entries.length; i++) {
      BeansFieldEntry e = entries[i];
      FieldOption op = getPropertyOption(e, implicitOption);
      e.setOption(op);
  }
  return entries;
    }
View Full Code Here

Examples of org.msgpack.template.FieldOption

  }
  return entries;
    }

    private FieldOption getPropertyOption(BeansFieldEntry e, FieldOption implicitOption) {
  FieldOption forGetter = getMethodOption(e.getPropertyDescriptor().getReadMethod());
  if (forGetter != FieldOption.DEFAULT) {
      return forGetter;
  }
  FieldOption forSetter = getMethodOption(e.getPropertyDescriptor().getWriteMethod());
  if (forSetter != FieldOption.DEFAULT) {
      return forSetter;
  } else {
      return implicitOption;
  }
View Full Code Here

Examples of org.msgpack.template.FieldOption

    @Override
    public void writeTemplate(Type targetType, String directoryName) {
  Class<?> targetClass = (Class<?>)targetType;
  checkClassValidation(targetClass);
  FieldOption implicitOption = getFieldOption(targetClass);
  FieldEntry[] entries = toFieldEntries(targetClass, implicitOption);
  writeTemplate(targetClass, entries, directoryName);
    }
View Full Code Here

Examples of org.msgpack.template.FieldOption

    @Override
    public <T> Template<T> loadTemplate(Type targetType) {
  Class<T> targetClass = (Class) targetType;
  checkClassValidation(targetClass);
  FieldOption implicitOption = getFieldOption(targetClass);
  FieldEntry[] entries = toFieldEntries(targetClass, implicitOption);
  return loadTemplate(targetClass, entries);
    }
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.