예제 #1
0
  /**
   * Parses a field type definition
   *
   * @param docField
   * @return
   */
  protected static Field ParseField(FieldDoc docField) {
    assert (docField != null);

    Field xmlField = new Field();

    xmlField.name = docField.name();
    xmlField.comment = docField.commentText();
    xmlField.type = ParseType(docField.type());
    xmlField.isFinal = docField.isFinal();
    if (xmlField.isFinal) {
      xmlField.finalExpression = docField.constantValueExpression();
    } else if (docField.constantValueExpression() != null) {
      // how would a non-final field have a constant value expression?
      // my understanding is that this field is only != null when is not final
      assert (false);
    }
    xmlField.isStatic = docField.isStatic();
    xmlField.isVolatile = docField.isVolatile();
    xmlField.isTransient = docField.isTransient();
    xmlField.scope = DetermineScope(docField);

    // parse annotations from the field
    xmlField.annotationInstances =
        ParseAnnotationInstances(docField.annotations(), docField.qualifiedName());

    return xmlField;
  }
예제 #2
0
  /**
   * Parses an enum type definition
   *
   * @param docField
   * @return
   */
  protected static EnumField ParseEnumField(FieldDoc docField) {
    assert (docField != null);

    EnumField xmlEnumField = new EnumField();

    xmlEnumField.name = docField.name();
    xmlEnumField.comment = docField.commentText();

    return xmlEnumField;
  }