net.sf.okapi.lib.xliff2.core

## Class Tag

- java.lang.Object
- - net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
  - - net.sf.okapi.lib.xliff2.core.Tag

- All Implemented Interfaces:
    IWithExtAttributes
  Direct Known Subclasses:
    CTag, MTag

      public abstract class Tag
      extends DataWithExtAttributes

  Provides the common methods for code and marker tags.

  Any object deriving from this class must also provide an implementation for `CloneFactory.create(Tag, Tags)`.

  See Also:
    `CTag`, `MTag`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TagType` | `tagType`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Tag()` Creates an empty `Tag` object.
    `` | `Tag(Tag original)` Copy constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract java.lang.String` | `getId()` Gets the id for the code or annotation using this tag.
    `TagType` | `getTagType()` Gets the `TagType` value of this tag.
    `abstract java.lang.String` | `getType()` Gets the type of the code or marker this tag represents.
    `abstract boolean` | `isCode()` Indicates if this tag is for a code (`CTag`).
    `abstract boolean` | `isMarker()` Indicates if this tag is for a marker (`MTag`).
    `abstract void` | `setType(java.lang.String type)` Sets the type of the code or marker (for both opening/closing tags).
    `java.lang.String` | `toString()`

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

      `getExtAttributes, getExtAttributeValue, hasExtAttribute, setExtAttributes`

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

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

- - ### Field Detail

    - #### tagType

          protected TagType tagType

  - ### Constructor Detail

    - #### Tag

          protected Tag()

      Creates an empty `Tag` object.

    - #### Tag

          public Tag(Tag original)

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

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getTagType

          public TagType getTagType()

      Gets the `TagType` value of this tag.
      Returns:
        the `TagType` value of this tag.

    - #### getId

          public abstract java.lang.String getId()

      Gets the id for the code or annotation using this tag.
      Returns:
        the id for the code or annotation using this tag.

    - #### getType

          public abstract java.lang.String getType()

      Gets the type of the code or marker this tag represents.
      Returns:
        the type of the code or marker this tag represents. If this is a `CTag` the type value can be null.

    - #### setType

          public abstract void setType(java.lang.String type)

      Sets the type of the code or marker (for both opening/closing tags).
      Parameters:
        `type` - the type of the code or marker this tag represents.

    - #### isMarker

          public abstract boolean isMarker()

      Indicates if this tag is for a marker (`MTag`).
      Returns:
        true if this tag is one for a marker (`MTag`), false if it is for a code (`CTag`).

    - #### isCode

          public abstract boolean isCode()

      Indicates if this tag is for a code (`CTag`).
      Returns:
        true if this tag is used by a code (`CTag`), false if it is for a marker (`MTag`).