Пример #1
0
  /**
   * Constructor.
   *
   * @param value a string value.
   */
  public TypeSpecImpl(String value) {
    this.form = ARRAY;

    TypeSpec indexType = new TypeSpecImpl(SUBRANGE);
    indexType.setAttribute(SUBRANGE_BASE_TYPE, Predefined.integerType);
    indexType.setAttribute(SUBRANGE_MIN_VALUE, 1);
    indexType.setAttribute(SUBRANGE_MAX_VALUE, value.length());

    setAttribute(ARRAY_INDEX_TYPE, indexType);
    setAttribute(ARRAY_ELEMENT_TYPE, Predefined.charType);
    setAttribute(ARRAY_ELEMENT_COUNT, value.length());
  }