net.sf.okapi.lib.xliff2.core

## Class MidFileData

- java.lang.Object
- - net.sf.okapi.lib.xliff2.core.MidFileData

- All Implemented Interfaces:
    IWithChangeTrack, IWithExtElements, IWithMetadata, IWithNotes, IWithValidation

      public class MidFileData
      extends java.lang.Object
      implements IWithNotes, IWithMetadata, IWithValidation, IWithChangeTrack

  Implements the `IWithExtElements` and `IWithNotes` interfaces.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MidFileData()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addNote(Note note)` Adds a note to the list of notes.
    `ChangeTrack` | `getChangeTrack()` Gets the `ChangeTrack` object for this element, creates an empty of if there is none.
    `ExtElements` | `getExtElements()` Gets the `ExtElements` object associated with this object.
    `Metadata` | `getMetadata()` Gets the `Metadata` object for the parent, creates an empty of if there is none.
    `int` | `getNoteCount()` Gets the number of notes for this object.
    `Notes` | `getNotes()` Gets the `Notes` object for this object.
    `Validation` | `getValidation()` Gets the `Validation` object for the parent, creates an empty of if there is none.
    `boolean` | `hasChangeTrack()` Check if there is at least a revision for this element.
    `boolean` | `hasExtElements()` Indicates if there is a `ExtElements` object associated with this object.
    `boolean` | `hasMetadata()` Indicates if the object has metadata.
    `boolean` | `hasValidation()` Indicates if the object has validation data.
    `void` | `setChangeTrack(ChangeTrack changeTrack)` Sets the `ChangeTrack` object for this element.
    `ExtElements` | `setExtElements(ExtElements elements)` Sets the `ExtElements` object associated with this object.
    `void` | `setMetadata(Metadata metadata)` sets the `Metadata` object for the parent.
    `void` | `setValidation(Validation validation)` sets the `Validation` object for the parent.

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

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

- - ### Constructor Detail

    - #### MidFileData

          public MidFileData()

  - ### Method Detail

    - #### addNote

          public void addNote(Note note)

      Description copied from interface: `IWithNotes`
      Adds a note to the list of notes.
      Specified by:
        `addNote` in interface `IWithNotes`
      Parameters:
        `note` - the note to add.

    - #### getNotes

          public Notes getNotes()

      Description copied from interface: `IWithNotes`
      Gets the `Notes` object for this object.
      Specified by:
        `getNotes` in interface `IWithNotes`
      Returns:
        the notes for this object. Never returns null.

    - #### getNoteCount

          public int getNoteCount()

      Description copied from interface: `IWithNotes`
      Gets the number of notes for this object.
      Specified by:
        `getNoteCount` in interface `IWithNotes`
      Returns:
        the number of notes available.

    - #### hasMetadata

          public boolean hasMetadata()

      Description copied from interface: `IWithMetadata`
      Indicates if the object has metadata.
      Specified by:
        `hasMetadata` in interface `IWithMetadata`

    - #### getMetadata

          public Metadata getMetadata()

      Description copied from interface: `IWithMetadata`
      Gets the `Metadata` object for the parent, creates an empty of if there is none.
      Specified by:
        `getMetadata` in interface `IWithMetadata`
      Returns:
        the `Metadata` object for the parent (can be empty, but never null).

    - #### setMetadata

          public void setMetadata(Metadata metadata)

      Description copied from interface: `IWithMetadata`
      sets the `Metadata` object for the parent.
      Specified by:
        `setMetadata` in interface `IWithMetadata`
      Parameters:
        `metadata` - the new `Metadata` object for the parent.

    - #### hasValidation

          public boolean hasValidation()

      Description copied from interface: `IWithValidation`
      Indicates if the object has validation data.
      Specified by:
        `hasValidation` in interface `IWithValidation`

    - #### getValidation

          public Validation getValidation()

      Description copied from interface: `IWithValidation`
      Gets the `Validation` object for the parent, creates an empty of if there is none.
      Specified by:
        `getValidation` in interface `IWithValidation`
      Returns:
        the `Validation` object for the parent (can be empty, but never null).

    - #### setValidation

          public void setValidation(Validation validation)

      Description copied from interface: `IWithValidation`
      sets the `Validation` object for the parent.
      Specified by:
        `setValidation` in interface `IWithValidation`
      Parameters:
        `validation` - the new `Validation` object for the parent.

    - #### getChangeTrack

          public ChangeTrack getChangeTrack()

      Description copied from interface: `IWithChangeTrack`
      Gets the `ChangeTrack` object for this element, creates an empty of if there is none.
      Specified by:
        `getChangeTrack` in interface `IWithChangeTrack`
      Returns:
        the `ChangeTrack` object for this element (can be empty, never null).

    - #### setChangeTrack

          public void setChangeTrack(ChangeTrack changeTrack)

      Description copied from interface: `IWithChangeTrack`
      Sets the `ChangeTrack` object for this element.
      Specified by:
        `setChangeTrack` in interface `IWithChangeTrack`
      Parameters:
        `changeTrack` - the `ChangeTrack` object for this element.

    - #### hasChangeTrack

          public boolean hasChangeTrack()

      Description copied from interface: `IWithChangeTrack`
      Check if there is at least a revision for this element.
      Specified by:
        `hasChangeTrack` in interface `IWithChangeTrack`
      Returns:
        `true` if there is at least a revision for this element; `false` otherwise.

    - #### getExtElements

          public ExtElements getExtElements()

      Description copied from interface: `IWithExtElements`
      Gets the `ExtElements` object associated with this object. If none exists one is created.
      Specified by:
        `getExtElements` in interface `IWithExtElements`
      Returns:
        the `ExtElements` object associated with this object. If none exists one is created.

    - #### hasExtElements

          public boolean hasExtElements()

      Description copied from interface: `IWithExtElements`
      Indicates if there is a `ExtElements` object associated with this object.
      Specified by:
        `hasExtElements` in interface `IWithExtElements`
      Returns:
        true if there is a `ExtElements` object associated with this object, false otherwise.

    - #### setExtElements

          public ExtElements setExtElements(ExtElements elements)

      Description copied from interface: `IWithExtElements`
      Sets the `ExtElements` object associated with this object.
      Specified by:
        `setExtElements` in interface `IWithExtElements`
      Parameters:
        `elements` - the `ExtElements` object associated with this object. If null, a new `ExtElements` object is created.
      Returns:
        the `ExtElements` object associated with this object, never null.