net.sf.okapi.common.resource

## Class InlineAnnotation

- java.lang.Object
- - net.sf.okapi.common.resource.InlineAnnotation

- All Implemented Interfaces:
    IAnnotation
  Direct Known Subclasses:
    GenericAnnotations

      public class InlineAnnotation
      extends java.lang.Object
      implements IAnnotation

  Base implementation of an annotation that can be used on inline codes. Inline annotations must have a `toString()` and `fromString(String)` methods to write and read themselves to and from a string.

  This basic annotation has only a string data. Its usage depends of the type of the annotation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `data`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InlineAnnotation()` Creates an empty annotation object.
    `InlineAnnotation(java.lang.String data)` Creates a new annotation object with some initial data.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `InlineAnnotation` | `clone()` Clones this annotation.
    `void` | `fromString(java.lang.String storage)` Initializes this annotation from a storage string originally obtained from `toString()`.
    `java.lang.String` | `getData()` Gets the data for this annotation.
    `void` | `setData(java.lang.String data)` Sets the data for this annotation.
    `java.lang.String` | `toString()` Gets a storage string representation of the whole annotation that can be used for serialization.

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

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

- - ### Field Detail

    - #### data

          protected java.lang.String data

  - ### Constructor Detail

    - #### InlineAnnotation

          public InlineAnnotation()

      Creates an empty annotation object.

    - #### InlineAnnotation

          public InlineAnnotation(java.lang.String data)

      Creates a new annotation object with some initial data.
      Parameters:
        `data` - The data to set.

  - ### Method Detail

    - #### clone

          public InlineAnnotation clone()

      Clones this annotation.
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        A new InlineAnnotation object that is a copy of this one.

    - #### toString

          public java.lang.String toString()

      Gets a storage string representation of the whole annotation that can be used for serialization.
      Specified by:
        `toString` in interface `IAnnotation`
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        The storage string representation of this annotation.

    - #### fromString

          public void fromString(java.lang.String storage)

      Initializes this annotation from a storage string originally obtained from `toString()`.
      Parameters:
        `storage` - The storage string to use for the initialization.

    - #### getData

          public java.lang.String getData()

      Gets the data for this annotation.
      Returns:
        The data of this annotation.

    - #### setData

          public void setData(java.lang.String data)

      Sets the data for this annotation.
      Parameters:
        `data` - The data to set.