net.sf.okapi.lib.xliff2.changeTracking

## Class Revisions

- java.lang.Object
- - net.sf.okapi.lib.xliff2.core.BaseList<Revision>
  - - net.sf.okapi.lib.xliff2.changeTracking.Revisions

- All Implemented Interfaces:
    java.lang.Iterable<Revision>, IWithExtAttributes

      public class Revisions
      extends BaseList<Revision>
      implements IWithExtAttributes

  Represents the `<revisions>` element of the ChangeTracking module.
  Author:
    Marta Borriello

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `APPLIES_TO_ATTR_NAME` `appliesTo` attribute name.
    `static java.lang.String` | `CURRENT_VERSION_ATTR_NAME` `currentVersion` attribute name.
    `static java.lang.String` | `REF_ATTR_NAME` `ref` attribute name.
    `static java.lang.String` | `TAG_NAME` The tag element name constant.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Revisions()` Default constructor.
    `Revisions(Revisions original)` Creates a copy of an existing `Revisions` object
    `Revisions(java.lang.String appliesTo)` Creates a new `Revisions` object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getAppliesTo()` Gets the value of the appliesTo attribute.
    `java.lang.String` | `getAttributesString()` Gets the attributes string.
    `java.lang.String` | `getClosingTag()` Gets the complete `revisions` closing tag.
    `java.lang.String` | `getClosingTagName()` Gets the closing `changeTrack` tag name.
    `java.lang.String` | `getCompleteOpeningTag()` Gets the complete `revisions` opening tag.
    `java.lang.String` | `getCurrentVersion()` Gets the value of the `currentVersion` attribute.
    `ExtAttributes` | `getExtAttributes()` Gets the `ExtAttributes` object for the parent object.
    `java.lang.String` | `getExtAttributeValue(java.lang.String namespaceURI, java.lang.String localName)` Gets the value for a given extension attribute.
    `java.lang.String` | `getOpeningTagName()` Gets the opening `revisions` tag name.
    `java.lang.String` | `getRef()` Gets the value for the ref attribute.
    `boolean` | `hasExtAttribute()` Indicates if at least one extension attribute is present.
    `void` | `setAppliesTo(java.lang.String appliesTo)` Sets the value to the `appliesTo` attribute.
    `void` | `setCurrentVersion(java.lang.String currentVersion)` Sets the value of the `currentVersion` attribute.
    `void` | `setExtAttributes(ExtAttributes attributes)` Sets the `ExtAttributes` object associated with this object.
    `void` | `setRef(java.lang.String ref)` Sets the value for the ref attribute.

    - ### Methods inherited from class net.sf.okapi.lib.xliff2.core.BaseList

      `add, clear, get, isEmpty, iterator, remove, remove, set, size`

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

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

- - ### Field Detail

    - #### TAG_NAME

          public static final java.lang.String TAG_NAME

      The tag element name constant.
      See Also:
        Constant Field Values

    - #### APPLIES_TO_ATTR_NAME

          public static final java.lang.String APPLIES_TO_ATTR_NAME

      `appliesTo` attribute name.
      See Also:
        Constant Field Values

    - #### REF_ATTR_NAME

          public static final java.lang.String REF_ATTR_NAME

      `ref` attribute name.
      See Also:
        Constant Field Values

    - #### CURRENT_VERSION_ATTR_NAME

          public static final java.lang.String CURRENT_VERSION_ATTR_NAME

      `currentVersion` attribute name.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Revisions

          public Revisions()

      Default constructor. Creates a new `Revisions` object.

    - #### Revisions

          public Revisions(java.lang.String appliesTo)

      Creates a new `Revisions` object.
      Parameters:
        `appliesTo` - the value for the REQUIRED attribute `appliesTo`.
      See Also:
        `setAppliesTo(String)`

    - #### Revisions

          public Revisions(Revisions original)

      Creates a copy of an existing `Revisions` object
      Parameters:
        `original` - the existing object to duplicate

  - ### Method Detail

    - #### setAppliesTo

          public final void setAppliesTo(java.lang.String appliesTo)

      Sets the value to the `appliesTo` attribute. It must be the name of any valid XLIFF element which is a sibling, or a child of a sibling element, to the change track module within the scope of the enclosing element. If a null or empty string is provided, an `IllegalArgumentException` is thrown.
      Parameters:
        `appliesTo` - the value for the appliesTo attribute.

    - #### getAppliesTo

          public java.lang.String getAppliesTo()

      Gets the value of the appliesTo attribute.
      Returns:
        the value of the appliesTo attribute.

    - #### setRef

          public void setRef(java.lang.String ref)

      Sets the value for the ref attribute.
      Parameters:
        `ref` - the value for the ref attribute.

    - #### getRef

          public java.lang.String getRef()

      Gets the value for the ref attribute.
      Returns:
        the value for the ref attribute (can be null).

    - #### setCurrentVersion

          public void setCurrentVersion(java.lang.String currentVersion)

      Sets the value of the `currentVersion` attribute.
      Parameters:
        `currentVersion` - must be the value of the `version` attribute of one of the `revision` elements listed in the same `revisions` element.

    - #### getCurrentVersion

          public java.lang.String getCurrentVersion()

      Gets the value of the `currentVersion` attribute.
      Returns:
        the value of the `currentVersion` attribute.

    - #### getExtAttributes

          public ExtAttributes getExtAttributes()

      Description copied from interface: `IWithExtAttributes`
      Gets the `ExtAttributes` object for the parent object. If none exists, one is created.
      Specified by:
        `getExtAttributes` in interface `IWithExtAttributes`
      Returns:
        the `ExtAttributes` object for the parent object, never null.

    - #### setExtAttributes

          public void setExtAttributes(ExtAttributes attributes)

      Description copied from interface: `IWithExtAttributes`
      Sets the `ExtAttributes` object associated with this object.
      Specified by:
        `setExtAttributes` in interface `IWithExtAttributes`
      Parameters:
        `attributes` - the `ExtAttributes` object associated with this object. If null, a new `ExtAttributes` object is created.

    - #### hasExtAttribute

          public boolean hasExtAttribute()

      Description copied from interface: `IWithExtAttributes`
      Indicates if at least one extension attribute is present.
      Specified by:
        `hasExtAttribute` in interface `IWithExtAttributes`
      Returns:
        true if at least one extension attribute is present; false otherwise.

    - #### getExtAttributeValue

          public java.lang.String getExtAttributeValue(java.lang.String namespaceURI,
                                              java.lang.String localName)

      Description copied from interface: `IWithExtAttributes`
      Gets the value for a given extension attribute.
      Specified by:
        `getExtAttributeValue` in interface `IWithExtAttributes`
      Parameters:
        `namespaceURI` - the URI of the namespace for the attribute.
        `localName` - the name of the attribute.
      Returns:
        the value of the extension attribute, or null if it does not exist.

    - #### getOpeningTagName

          public java.lang.String getOpeningTagName()

      Gets the opening `revisions` tag name.
      Returns:
        the opening `revisions` tag name.

    - #### getAttributesString

          public java.lang.String getAttributesString()

      Gets the attributes string.
      Returns:
        the attributes string.

    - #### getClosingTagName

          public java.lang.String getClosingTagName()

      Gets the closing `changeTrack` tag name.
      Returns:
        the closing `changeTrack` tag name.

    - #### getCompleteOpeningTag

          public java.lang.String getCompleteOpeningTag()

      Gets the complete `revisions` opening tag.
      Returns:
        the complete `revisions` opening tag.

    - #### getClosingTag

          public java.lang.String getClosingTag()

      Gets the complete `revisions` closing tag.
      Returns:
        the complete `revisions` closing tag.