net.sf.okapi.lib.xliff2.its

## Class DataCategoryGroup<T extends DataCategory>

- java.lang.Object
- - net.sf.okapi.lib.xliff2.its.DataCategoryGroup<T>

- All Implemented Interfaces:
    IITSItem
  Direct Known Subclasses:
    LocQualityIssues, Provenances

      public abstract class DataCategoryGroup<T extends DataCategory>
      extends java.lang.Object
      implements IITSItem

  Represents a stand-off group for a given data category that can have multiple instances.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataCategoryGroup(java.lang.String id)` Creates a new `DataCategoryGroup` object with a given identifier.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getAnnotatorRef()` Gets the annotator reference currently set for this data category.
    `java.lang.String` | `getGroupId()` Gets the identifier for this group.
    `java.util.List<T>` | `getList()` Gets the list of instances for this group.
    `boolean` | `hasUnresolvedGroup()` Indicates if this item has currently a reference to a stand-off element that has not been resolved yet.
    `boolean` | `isGroup()` Indicates if this item is a group.
    `void` | `setAnnotatorRef(AnnotatorsRef ar)` Sets the annotator reference information for this data category.
    `void` | `setAnnotatorRef(java.lang.String annotatorRef)` Sets the annotator reference information for this data category.
    `void` | `setGroupId(java.lang.String id)` Sets the identifier for this group.
    `void` | `validate()` Validates the data category.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface net.sf.okapi.lib.xliff2.its.IITSItem

      `createCopy, getDataCategoryName`

- - ### Constructor Detail

    - #### DataCategoryGroup

          public DataCategoryGroup(java.lang.String id)

      Creates a new `DataCategoryGroup` object with a given identifier.
      Parameters:
        `id` - the identifier to use (use null to create one automatically)

  - ### Method Detail

    - #### isGroup

          public boolean isGroup()

      Description copied from interface: `IITSItem`
      Indicates if this item is a group.
      Specified by:
        `isGroup` in interface `IITSItem`
      Returns:
        true if it is a group, false if it is a standalone data category instance.

    - #### hasUnresolvedGroup

          public boolean hasUnresolvedGroup()

      Description copied from interface: `IITSItem`
      Indicates if this item has currently a reference to a stand-off element that has not been resolved yet.

      This occurs for example when a unit element has a reference to a set of Provenance instances and the stand-off element has not been read yet (because the reading of the unit's element is done after the reading of its attributes.

      Specified by:
        `hasUnresolvedGroup` in interface `IITSItem`
      Returns:
        true if this item has currently an unresolved reference to a stand-off element.

    - #### getGroupId

          public java.lang.String getGroupId()

      Gets the identifier for this group.
      Returns:
        the identifier for this group.

    - #### setGroupId

          public void setGroupId(java.lang.String id)

      Sets the identifier for this group.
      Parameters:
        `id` - the identifier to set.

    - #### getList

          public java.util.List<T> getList()

      Gets the list of instances for this group.
      Returns:
        the list of instances for this group.

    - #### setAnnotatorRef

          public void setAnnotatorRef(java.lang.String annotatorRef)

      Description copied from interface: `IITSItem`
      Sets the annotator reference information for this data category.
      Specified by:
        `setAnnotatorRef` in interface `IITSItem`
      Parameters:
        `annotatorRef` - the reference string to set (can be null).

    - #### setAnnotatorRef

          public void setAnnotatorRef(AnnotatorsRef ar)

      Description copied from interface: `IITSItem`
      Sets the annotator reference information for this data category.
      Specified by:
        `setAnnotatorRef` in interface `IITSItem`
      Parameters:
        `ar` - the set of references read from `its:annotatorsRef`. If it is null, or if there is no reference for the relevant data category: no change is made.

    - #### getAnnotatorRef

          public java.lang.String getAnnotatorRef()

      Description copied from interface: `IITSItem`
      Gets the annotator reference currently set for this data category. This method is not be supported for items that are data category groups.
      Specified by:
        `getAnnotatorRef` in interface `IITSItem`
      Returns:
        the annotator reference currently set for this data category.

    - #### validate

          public void validate()

      Description copied from interface: `IITSItem`
      Validates the data category. Checks if all required attributes are set properly.
      Specified by:
        `validate` in interface `IITSItem`