net.sf.okapi.lib.xliff2.glossary

## Class GlossEntry

- java.lang.Object
- - net.sf.okapi.lib.xliff2.glossary.GlossEntry

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

      public class GlossEntry
      extends java.lang.Object
      implements IWithExtAttributes, IWithExtElements, java.lang.Iterable<Translation>

  Represents the <glossEntry> element of the Glossary module.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GlossEntry()` Creates a new `GlossEntry` object.
    `GlossEntry(GlossEntry original)` Copy constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addTranslation(java.lang.String text)` Adds a translation to this entry.
    `Definition` | `getDefinition()` Gets the definition for this entry.
    `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.
    `ExtElements` | `getExtElements()` Gets the `ExtElements` object associated with this object.
    `java.lang.String` | `getId()` Gets the id for this entry.
    `java.lang.String` | `getRef()` Gets the reference for this entry.
    `Term` | `getTerm()` Gets the term for this entry.
    `java.util.List<Translation>` | `getTranslations()` Gets the list of the `Translation` objects for this entry.
    `boolean` | `hasExtAttribute()` Indicates if at least one extension attribute is present.
    `boolean` | `hasExtElements()` Indicates if there is a `ExtElements` object associated with this object.
    `java.util.Iterator<Translation>` | `iterator()`
    `void` | `setDefinition(Definition definition)` Sets a new definition for this entry.
    `void` | `setExtAttributes(ExtAttributes attributes)` Sets the `ExtAttributes` object associated with this object.
    `ExtElements` | `setExtElements(ExtElements elements)` Sets the `ExtElements` object associated with this object.
    `void` | `setId(java.lang.String id)` Sets the id for this entry.
    `void` | `setRef(java.lang.String ref)` Sets the reference for this entry.
    `void` | `setTerm(Term term)` Sets a new term for this entry.

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

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

- - ### Constructor Detail

    - #### GlossEntry

          public GlossEntry()

      Creates a new `GlossEntry` object.

    - #### GlossEntry

          public GlossEntry(GlossEntry original)

      Copy constructor.
      Parameters:
        `original` - the original object to duplicate.

  - ### Method Detail

    - #### getId

          public java.lang.String getId()

      Gets the id for this entry.
      Returns:
        the id for this entry (can be null).

    - #### setId

          public void setId(java.lang.String id)

      Sets the id for this entry.
      Parameters:
        `id` - the new id for this entry (can be null).

    - #### getRef

          public java.lang.String getRef()

      Gets the reference for this entry.
      Returns:
        the reference for this entry (can be null).

    - #### setRef

          public void setRef(java.lang.String ref)

      Sets the reference for this entry.
      Parameters:
        `ref` - the new reference for this entry (can be null).

    - #### getTerm

          public Term getTerm()

      Gets the term for this entry.
      Returns:
        the term for this entry.

    - #### setTerm

          public void setTerm(Term term)

      Sets a new term for this entry.
      Parameters:
        `term` - the new term for this entry (must not be null).

    - #### getDefinition

          public Definition getDefinition()

      Gets the definition for this entry.
      Returns:
        the definition for this entry (can be null).

    - #### setDefinition

          public void setDefinition(Definition definition)

      Sets a new definition for this entry.
      Parameters:
        `definition` - the new definition for this entry (can be null).

    - #### addTranslation

          public void addTranslation(java.lang.String text)

      Adds a translation to this entry.
      Parameters:
        `text` - the text of the translation to add.

    - #### 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.

    - #### 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.

    - #### 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.

    - #### 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.

    - #### iterator

          public java.util.Iterator<Translation> iterator()

      Specified by:
        `iterator` in interface `java.lang.Iterable<Translation>`

    - #### getTranslations

          public java.util.List<Translation> getTranslations()

      Gets the list of the `Translation` objects for this entry.
      Returns:
        the list of the `Translation` objects for this entry (never null).