code: Object getDataValuesForType(Entity entity, Attribute attribute) {
      String attributeName = attribute.getName();
      switch (attribute.getDataType()) {
        case DATE:
          return entity.getLocalDate(attributeName);
        case DATE_TIME:
          return entity.getInstant(attributeName);
        case BOOL:
          return entity.getBoolean(attributeName);
        case DECIMAL:
          return entity.getDouble(attributeName);
        case LONG:
          return entity.getLong(attributeName);
        case INT:
          return entity.getInt(attributeName);
        case HYPERLINK:
        case ENUM:
        case HTML:
        case TEXT:
        case SCRIPT:
        case EMAIL:
        case STRING:
          return entity.getString(attributeName);
        case CATEGORICAL:
        case XREF:
        case FILE:
          Entity refEntity = entity.getEntity(attributeName);
          if (refEntity != null) return refEntity.getIdValue();
          else return "";
        case CATEGORICAL_MREF:
        case MREF:
          List<String> mrefValues = newArrayList();
          for (Entity mrefEntity : entity.getEntities(attributeName)) {
            if (mrefEntity != null) {
              mrefValues.add(mrefEntity.getIdValue().toString());
            }
          }
          return mrefValues;
        case COMPOUND:
          return "";
        default:
          return "";
      }
    }
docs: Package-private for testability.