net.sf.okapi.lib.xliff2.core

## Class Unit

- java.lang.Object
- - net.sf.okapi.lib.xliff2.core.InheritedData
  - - net.sf.okapi.lib.xliff2.core.Unit

- All Implemented Interfaces:
    java.lang.Iterable<Part>, IWithChangeTrack, IWithExtAttributes, IWithExtElements, IWithInheritedData, IWithMetadata, IWithNotes, IWithStore, IWithValidation, IWithITSAttributes, IWithITSGroups

      public class Unit
      extends InheritedData
      implements java.lang.Iterable<Part>, IWithStore, IWithITSAttributes, IWithITSGroups

  Represents the XLIFF `<unit>` element. A unit is made of a list of `Part` objects, some of which are `Segment` objects.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Unit(java.lang.String id)` Creates a new `Unit` object.
    `Unit(java.lang.String id, StartFileData startFileData)` Creates a new `Unit` object with a given id and file context.
    `Unit(Unit original)` Copy constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataCategoryGroup<?>` | `addITSGroup(DataCategoryGroup<?> group)` Adds an ITS group to this object.
    `void` | `addNote(Note note)` Adds a note to the list of notes.
    `Part` | `appendIgnorable()` Appends an empty ignorable part to this unit.
    `Segment` | `appendSegment()` Appends a new empty segment to this unit.
    `boolean` | `doNonEmptySourcesHaveNonEmptyTargets()` Indicates if all parts (segments and ignorables) of this unit that have a non-empty source have also a non-empty target.
    `java.util.List<AnnotatedSpan>` | `getAnnotatedSpans(boolean target)` Creates a list of the annotated spans in this unit.
    `ChangeTrack` | `getChangeTrack()` Gets the `ChangeTrack` object for this element, creates an empty of if there is none.
    `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.
    `Glossary` | `getGlossary()` Gets the `Glossary` object for this unit, creates an empty of if there is none.
    `java.lang.String` | `getId()` Gets the id for this object.
    `java.util.List<DataCategoryGroup<?>>` | `getITSGroups()` Gets the ITS groups associated with this object.
    `ITSItems` | `getITSItems()` Gets the ITS items associated with this object.
    `Matches` | `getMatches()` Gets the `Matches` object for this unit, creates an empty of if there is none.
    `Metadata` | `getMetadata()` Gets the `Metadata` object for the parent, creates an empty of if there is none.
    `java.lang.String` | `getName()` Gets the name for this group.
    `int` | `getNoteCount()` Gets the number of notes for this object.
    `Notes` | `getNotes()` Gets the `Notes` object for this object.
    `java.lang.Object` | `getObjectFromId(java.lang.String id)` Gets the object associated with a given span-class id in this unit.
    `java.util.List<CTag>` | `getOrderedCTags(boolean target)` Creates the list of `CTag` in the source or target content, in their respective order.
    `Part` | `getPart(int partIndex)` Gets the part at a given index.
    `int` | `getPartCount()` Gets the number of parts in this unit.
    `java.lang.String` | `getPlainText(boolean target, boolean useSourceForMissingTargetIgnorables)` Gets the plain text version of the full content of this unit, for either the source or the target.
    `Segment` | `getSegment(int segIndex)` Gets the segment at a given index.
    `int` | `getSegmentCount()` Gets the number of segments in this unit.
    `java.lang.Iterable<Segment>` | `getSegments()` Creates an `Iterable` object for the segments in this unit.
    `java.lang.Object` | `getSourceOrTargetReference(java.lang.String ref)` Gets the span-like object associated with a given id in this unit.
    `Store` | `getStore()` Gets the store for this unit.
    `java.util.List<Part>` | `getTargetOrderedParts()` Gets the list of the parts for this unit in the order specified for the target content.
    `java.util.List<java.lang.Boolean>` | `getTranslateStateEndings(boolean doSource)` Creates a list of booleans corresponding to the translate state at the end of each part in this unit.
    `java.lang.String` | `getType()` Gets the type for this group.
    `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` | `hasExtAttribute()` Indicates if at least one extension attribute is present.
    `boolean` | `hasExtElements()` Indicates if there is a `ExtElements` object associated with this object.
    `boolean` | `hasGlossEntry()` Indicates if this unit has at least one glossary entry.
    `boolean` | `hasITSGroup()` Indicates if the object has at least one ITS group.
    `boolean` | `hasITSItem()` Indicates if the object has at least one ITS item.
    `boolean` | `hasMatch()` Indicates if this unit has at least one match.
    `boolean` | `hasMetadata()` Indicates if the object has metadata.
    `boolean` | `hasTargetOrder()` Indicates if this unit has at least one target part not in the same order as the source.
    `boolean` | `hasValidation()` Indicates if the object has validation data.
    `void` | `hideProtectedContent()` Hides all protected spans of this unit into `PCont` objects.
    `boolean` | `isIdUsed(java.lang.String id)` Indicates if a given id value is already in use in the object (for a `Part` or for a `Tag`).
    `java.util.Iterator<Part>` | `iterator()` Creates a new iterator to loop through the segments and ignorables of this unit.
    `void` | `join(int startPartIndex, int endPartIndex, boolean restrictedJoin, boolean adjustTargetIgnorable)` Joins two or more parts together into the first one.
    `void` | `joinAll(boolean adjustTargetIgnorable)`
    `void` | `removeMarkers()` Removes all the annotation markers from the source and target (if a target is available) in this unit.
    `void` | `setChangeTrack(ChangeTrack changeTrack)` Sets the `ChangeTrack` object for this element.
    `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` | `setGlossary(Glossary glossary)` sets the `Glossary` object for this unit.
    `void` | `setId(java.lang.String id)` Sets the id for this object.
    `void` | `setITSItems(ITSItems itsItems)` Sets the list of the ITS items associated with this object.
    `void` | `setMatches(Matches matches)` sets the `Matches` object for this unit.
    `void` | `setMetadata(Metadata metadata)` sets the `Metadata` object for the parent.
    `void` | `setName(java.lang.String name)` Sets the name for this group.
    `void` | `setType(java.lang.String type)` Sets the type for this group.
    `void` | `setValidation(Validation validation)` sets the `Validation` object for the parent.
    `void` | `showProtectedContent()` Show all `PCont` references in this unit into content.
    `void` | `split(int partIndex, int srcStart, int srcEnd, int trgStart, int trgEnd, boolean changeState)` Splits a segment.
    `void` | `verifyOpeningsBeforeClosings(boolean target)` Verifies that all opening tags in the source or targt content of this unit are located before their closing counterparts.
    `void` | `verifyReadOnlyTags()` Verifies if the non-removable tags in the source content of this unit are present in the target.

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

      `getAnnotatorsRef, getCanResegment, getSourceDir, getTargetDir, getTranslate, setAnnotatorsRef, setCanResegment, setInheritableData, setSourceDir, setTargetDir, setTranslate`

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

      `getSourceDir, getTargetDir, setSourceDir, setTargetDir`

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

      `getId`

- - ### Constructor Detail

    - #### Unit

          public Unit(Unit original)

      Copy constructor.

      Important: Most of the time you MUST change the id of the resulting unit as a unit id must be unique within its parent file element.

      Parameters:
        `original` - the original unit to duplicate.

    - #### Unit

          public Unit(java.lang.String id)

      Creates a new `Unit` object.
      Parameters:
        `id` - the id of the unit.

    - #### Unit

          public Unit(java.lang.String id,
              StartFileData startFileData)

      Creates a new `Unit` object with a given id and file context.
      Parameters:
        `id` - the id of the unit.
        `startFileData` - the file context (can be null).

  - ### Method Detail

    - #### iterator

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

      Creates a new iterator to loop through the segments and ignorables of this unit.
      Specified by:
        `iterator` in interface `java.lang.Iterable<Part>`
      Returns:
        a new iterator to loop through the segments and ignorables of this unit.

    - #### getPartCount

          public int getPartCount()

      Gets the number of parts in this unit.
      Returns:
        the number of parts in this unit.

    - #### getSegmentCount

          public int getSegmentCount()

      Gets the number of segments in this unit.
      Returns:
        the number of segments in this unit.

    - #### appendSegment

          public Segment appendSegment()

      Appends a new empty segment to this unit.
      Returns:
        the new segment created.

    - #### appendIgnorable

          public Part appendIgnorable()

      Appends an empty ignorable part to this unit.
      Returns:
        the new ignorable part created.

    - #### getPart

          public Part getPart(int partIndex)

      Gets the part at a given index.
      Parameters:
        `partIndex` - the index of the part to retrieve (between 0 and `getPartCount()`-1).
      Returns:
        the `Part` object at the given index position, the part may or may not be a `Segment`.
      Throws:
        `java.lang.IndexOutOfBoundsException` - if the index is invalid.

    - #### getSegment

          public Segment getSegment(int segIndex)

      Gets the segment at a given index. Note that the retrieval of the object is not direct, but rely on looping through the parts.
      Parameters:
        `segIndex` - the index of the segment to retrieve (between 0 and `getSegmentCount()`-1).
      Returns:
        the `Segment` object at the given index position.
      Throws:
        `java.lang.IndexOutOfBoundsException` - if the index is invalid.

    - #### getStore

          public Store getStore()

      Gets the store for this unit.
      Returns:
        the `Store` object for this unit.

    - #### isIdUsed

          public boolean isIdUsed(java.lang.String id)

      Description copied from interface: `IWithStore`
      Indicates if a given id value is already in use in the object (for a `Part` or for a `Tag`).
      Specified by:
        `isIdUsed` in interface `IWithStore`
      Parameters:
        `id` - the id value to lookup.
      Returns:
        true if the value is already used, false otherwise.

    - #### getObjectFromId

          public java.lang.Object getObjectFromId(java.lang.String id)

      Gets the object associated with a given span-class id in this unit.

      The objects checked are: the parts (including segments) and all the tags except the `PCont` objects.

      Parameters:
        `id` - the id to look for.
      Returns:
        the object found, or null if not found.

    - #### split

          public void split(int partIndex,
                   int srcStart,
                   int srcEnd,
                   int trgStart,
                   int trgEnd,
                   boolean changeState)

      Splits a segment.
      Parameters:
        `partIndex` - the part index of the segment to split.
        `srcStart` - the start position of the middle new segment for the source (inclusive, in coded text).
        `srcEnd` - the end position of the middle new segment for the source (exclusive, in coded text), use -1 for the end of the current segment.
        `trgStart` - the start position of the middle new segment for the target (inclusive, in coded text).
        `trgEnd` - the end position of the middle new segment for the target (exclusive, in coded text).
        `changeState` - true to change the state and possibly the subState attributes for the modified or added segments if the initial segment as a target and its state is other than "initial" and "translated". Use false to keep the same state and subState.

    - #### hasTargetOrder

          public boolean hasTargetOrder()

      Indicates if this unit has at least one target part not in the same order as the source.
      Returns:
        true if there is a target-specific order for this unit, false otherwise

    - #### join

          public void join(int startPartIndex,
                  int endPartIndex,
                  boolean restrictedJoin,
                  boolean adjustTargetIgnorable)

      Joins two or more parts together into the first one.
      Parameters:
        `startPartIndex` - the index of the first part to join (in the target order)
        `endPartIndex` - the index of the last part to join (in the target order)
        `restrictedJoin` - true to throw an exception if one of the segment cannot be merged, false to allow to merge regardless of the canResegment values (merger mode)
        `adjustTargetIgnorable` - TODO

    - #### joinAll

          public void joinAll(boolean adjustTargetIgnorable)

    - #### getSegments

          public java.lang.Iterable<Segment> getSegments()

      Creates an `Iterable` object for the segments in this unit.

      Use `getTargetOrderedParts()` to get a list of the parts in target order.

      Returns:
        a new `Iterable` object for the segments in this unit.

    - #### getTargetOrderedParts

          public java.util.List<Part> getTargetOrderedParts()

      Gets the list of the parts for this unit in the order specified for the target content.
      Returns:
        a list of all the parts, in the target order.

    - #### getPlainText

          public java.lang.String getPlainText(boolean target,
                                      boolean useSourceForMissingTargetIgnorables)

      Gets the plain text version of the full content of this unit, for either the source or the target.
      Parameters:
        `target` - true to generate the text for the target, false for the source.
        `useSourceForMissingTargetIgnorables` - true to use the source content when generating the target text and a target ignorable is missing. this parameter is ignored when generating the source text.
      Returns:
        the plain text full content requested.

    - #### hideProtectedContent

          public void hideProtectedContent()

      Hides all protected spans of this unit into `PCont` objects. No target parts are created.
      See Also:
        `showProtectedContent()`

    - #### getTranslateStateEndings

          public java.util.List<java.lang.Boolean> getTranslateStateEndings(boolean doSource)

      Creates a list of booleans corresponding to the translate state at the end of each part in this unit.
      Parameters:
        `doSource` - true to generates the list from the source viewpoint, false to do it for the target.
      Returns:
        a list of booleans where true means the state of translate at the end of the corresponding part is 'yes', and false means it is 'no'.

    - #### showProtectedContent

          public void showProtectedContent()

      Show all `PCont` references in this unit into content.
      See Also:
        `hideProtectedContent()`

    - #### verifyOpeningsBeforeClosings

          public void verifyOpeningsBeforeClosings(boolean target)

      Verifies that all opening tags in the source or targt content of this unit are located before their closing counterparts.
      Parameters:
        `target` - true to verify the target, false to verify the source.

    - #### verifyReadOnlyTags

          public void verifyReadOnlyTags()

      Verifies if the non-removable tags in the source content of this unit are present in the target. Note that only the source tags that are in parts with an existing target are verified (as the absence of target is allowed).

    - #### getSourceOrTargetReference

          public java.lang.Object getSourceOrTargetReference(java.lang.String ref)

      Gets the span-like object associated with a given id in this unit.
      Parameters:
        `ref` - the reference of the object.
      Returns:
        the object or null if not found.

    - #### getOrderedCTags

          public java.util.List<CTag> getOrderedCTags(boolean target)

      Creates the list of `CTag` in the source or target content, in their respective order. This method does not check content inside protected text.
      Parameters:
        `target` - true to create the target list (in target order).
      Returns:
        the list of codes.

    - #### doNonEmptySourcesHaveNonEmptyTargets

          public boolean doNonEmptySourcesHaveNonEmptyTargets()

      Indicates if all parts (segments and ignorables) of this unit that have a non-empty source have also a non-empty target.
      Returns:
        true if all source parts that are not empty have a non-empty target too, false otherwise.

    - #### removeMarkers

          public void removeMarkers()

      Removes all the annotation markers from the source and target (if a target is available) in this unit.

    - #### addITSGroup

          public DataCategoryGroup<?> addITSGroup(DataCategoryGroup<?> group)

      Description copied from interface: `IWithITSGroups`
      Adds an ITS group to this object.
      Specified by:
        `addITSGroup` in interface `IWithITSGroups`
      Parameters:
        `group` - the group to add.

    - #### hasITSGroup

          public boolean hasITSGroup()

      Description copied from interface: `IWithITSGroups`
      Indicates if the object has at least one ITS group.
      Specified by:
        `hasITSGroup` in interface `IWithITSGroups`
      Returns:
        true if the object has at least one ITS group.

    - #### getITSGroups

          public java.util.List<DataCategoryGroup<?>> getITSGroups()

      Description copied from interface: `IWithITSGroups`
      Gets the ITS groups associated with this object.
      Specified by:
        `getITSGroups` in interface `IWithITSGroups`
      Returns:
        the ITS groups associated with this object (can be empty, but never null).

    - #### hasITSItem

          public boolean hasITSItem()

      Description copied from interface: `IWithITSAttributes`
      Indicates if the object has at least one ITS item.
      Specified by:
        `hasITSItem` in interface `IWithITSAttributes`
      Returns:
        true if the object has at least one ITS item.

    - #### getITSItems

          public ITSItems getITSItems()

      Description copied from interface: `IWithITSAttributes`
      Gets the ITS items associated with this object.
      Specified by:
        `getITSItems` in interface `IWithITSAttributes`
      Returns:
        the ITS items associated with this object (can be empty, but never null).

    - #### setITSItems

          public void setITSItems(ITSItems itsItems)

      Description copied from interface: `IWithITSAttributes`
      Sets the list of the ITS items associated with this object.
      Specified by:
        `setITSItems` in interface `IWithITSAttributes`
      Parameters:
        `itsItems` - the new items to set.

    - #### hasMatch

          public boolean hasMatch()

      Indicates if this unit has at least one match.
      Returns:
        true if this unit has at least one match, false if not.

    - #### getMatches

          public Matches getMatches()

      Gets the `Matches` object for this unit, creates an empty of if there is none.
      Returns:
        the `Matches` object for this unit (can be empty, but never null).

    - #### setMatches

          public void setMatches(Matches matches)

      sets the `Matches` object for this unit.
      Parameters:
        `matches` - the new `Matches` object for this unit.

    - #### hasGlossEntry

          public boolean hasGlossEntry()

      Indicates if this unit has at least one glossary entry.
      Returns:
        true if this unit has at least one glossary entry, false if not.

    - #### getGlossary

          public Glossary getGlossary()

      Gets the `Glossary` object for this unit, creates an empty of if there is none.
      Returns:
        the `Glossary` object for this unit (can be empty, but never null).

    - #### setGlossary

          public void setGlossary(Glossary glossary)

      sets the `Glossary` object for this unit.
      Parameters:
        `glossary` - the new `Glossary` object for this unit.

    - #### getAnnotatedSpans

          public java.util.List<AnnotatedSpan> getAnnotatedSpans(boolean target)

      Creates a list of the annotated spans in this unit.

      The `Part` and `MTag` objects in the list are live references, but any static data (e.g. the start and end position of the span) are a snapshot of the information at the moment of the call, any change to the content may make that information out-of-date and invalid.

      The spans are listed in the order their opening markers appears in the coded text.

      The call is expected to be made on a unit with no hidden protected content.

      Parameters:
        `target` - true to lookup the target, false to lookup the source.
      Returns:
        a list of `AnnotatedSpan` objects for this unit.

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

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

    - #### getName

          public java.lang.String getName()

      Gets the name for this group.
      Returns:
        the name for this group (can be null).

    - #### setName

          public void setName(java.lang.String name)

      Sets the name for this group.
      Parameters:
        `name` - the new name to set (can be null).

    - #### getType

          public java.lang.String getType()

      Gets the type for this group.
      Returns:
        the type for this group (can be null).

    - #### setType

          public void setType(java.lang.String type)

      Sets the type for this group. The value must have a prefix (for both unit and group elements)
      Parameters:
        `type` - the new type to set (can be null).

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

    - #### setId

          public void setId(java.lang.String id)

      Sets the id for this object.
      Parameters:
        `id` - the id for this object.

    - #### getId

          public java.lang.String getId()

      Gets the id for this object.
      Returns:
        the id for this object.

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