Package apigen.adt

Examples of apigen.adt.Field


          .getElementType());
      println("      " + elementType + " _head = nodes[i].getHead();");

      Iterator<Field> separators = type.separatorFieldIterator();
      while (separators.hasNext()) {
        Field separator = separators.next();
        String fieldId = separator.getId();
        String fieldName = JavaGenerator.getFieldId(fieldId);
        String fieldType = TypeGenerator.qualifiedClassName(params,
            separator.getType());
        String capitalizedFieldId = StringConversions
            .makeCapitalizedIdentifier(fieldId);
        String fieldGetter = "get" + capitalizedFieldId + "()";
        println("      " + fieldType + ' ' + fieldName
            + " = nodes[i-1]." + fieldGetter + ";");
View Full Code Here


    println();
  }

  private void genAddFieldsToListCalls(Iterator<Field> fields) {
    for (int i = 0; fields.hasNext(); i++) {
      Field field = fields.next();
      String field_type = field.getType();
      String getArgumentCall = "arg.get"
          + StringConversions
              .makeCapitalizedIdentifier(field.getId()) + "()";

      if (field_type.equals("str")) {
        println("    args.add(" + getArgumentCall + ");");
      } else if (field_type.equals("int")) {
        println("    args.add(new Integer(" + getArgumentCall + "));");
View Full Code Here

    println("      return " + methodName + "(");

    Iterator<Field> fields = type.altFieldIterator(alt.getId());
    int argnr = 0;
    while (fields.hasNext()) {
      Field field = fields.next();
      print("        " + buildFieldMatchResultRetriever(argnr, field));
      if (fields.hasNext()) {
        print(",");
      }
      println();
View Full Code Here

      println("      args.add(" + boxedHead + ");");

      Iterator<Field> separators = type.separatorFieldIterator();
      while (separators.hasNext()) {
        Field separator = separators.next();
        String fieldId = separator.getId();
        String fieldType = separator.getType();
        String capitalizedFieldId = StringConversions
            .makeCapitalizedIdentifier(fieldId);
        String fieldGetter = "get" + capitalizedFieldId + "()";
        String boxedField = BoxingBuilder.buildBoxer(fieldType,
            fieldGetter);
View Full Code Here

  private int genFromTermSeparatorFieldAssigments(SeparatedListType type) {
    JavaGenerationParameters params = getJavaGenerationParameters();
    Iterator<Field> fields = type.separatorFieldIterator();
    int i;
    for (i = 1; fields.hasNext(); i++) {
      Field field = fields.next();
      String fieldId = JavaGenerator.getFieldId(field.getId());
      String fieldType = TypeGenerator.qualifiedClassName(params, field
          .getType());
      println("      " + fieldType + " " + fieldId + " = "
          + buildFieldMatchResultRetriever(i, field) + ";");
    }
    return i;
View Full Code Here

    Iterator<Field> fields = type.altFieldIterator(alt.getId());
    print("(");
    if (fields.hasNext()) {
      while (fields.hasNext()) {
        Field field = fields.next();
        String field_id = impl.FieldName(field.getId());
        String field_class = impl.FieldType(field.getType());
        String field_type = field_class;
        print(field_id + ":" + field_type);

        if (fields.hasNext()) {
          print(", ");
        }
      }
    }
    print(")");
    println(" {");
    String isfsymimpl = "false";
    if (!tomConverter.isReserved(type.getId())) {
      isfsymimpl = prefix
          + impl.OperatorIsFSym("t", class_name, operator_name);
    }
    println("  is_fsym(t) { " + isfsymimpl + "}");

    if (!tomConverter.isReserved(type.getId())) {
      fields = type.altFieldIterator(alt.getId());
      while (fields.hasNext()) {
        Field field = fields.next();
        String field_id = StringConversions.makeIdentifier(field
            .getId());
        println("  get_slot(" + field_id + ",t) { "
            + impl.OperatorGetSlot("t", class_name, field_id) + "}");
      }
    }
View Full Code Here

TOP

Related Classes of apigen.adt.Field

Copyright © 2018 www.massapicom. 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.