net.sf.okapi.common

## Interface IResource

- All Known Subinterfaces:
    INameable, ITextUnit
  All Known Implementing Classes:
    BaseNameable, BaseReferenceable, Document, DocumentPart, Ending, EndSubfilter, MultiEvent, PipelineParameters, RawDocument, StartDocument, StartGroup, StartSubDocument, StartSubfilter, StorageList, TextContainer, TextUnit

      public interface IResource

  Common set of features all the types of resources associated with events have.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `COPY_ALL`
    `static int` | `COPY_CONTENT`
    `static int` | `COPY_PROPERTIES`
    `static int` | `COPY_SEGMENTATION`
    `static int` | `COPY_SEGMENTED_CONTENT`
    `static int` | `CREATE_EMPTY`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<A extends IAnnotation> A` | `getAnnotation(java.lang.Class<A> annotationType)` Gets the annotation object for a given class for this resource.
    `java.lang.Iterable<IAnnotation>` | `getAnnotations()` Gets the iterable list of the annotations for this resource.
    `java.lang.String` | `getId()` Gets the identifier of the resource.
    `ISkeleton` | `getSkeleton()` Gets the skeleton object for this resource.
    `void` | `setAnnotation(IAnnotation annotation)` Sets an annotation object for this resource.
    `void` | `setId(java.lang.String id)` Sets the identifier of this resource.
    `void` | `setSkeleton(ISkeleton skeleton)` Sets the skeleton object for this resource.

- - ### Field Detail

    - #### CREATE_EMPTY

          static final int CREATE_EMPTY

      See Also:
        Constant Field Values

    - #### COPY_CONTENT

          static final int COPY_CONTENT

      See Also:
        Constant Field Values

    - #### COPY_PROPERTIES

          static final int COPY_PROPERTIES

      See Also:
        Constant Field Values

    - #### COPY_SEGMENTATION

          static final int COPY_SEGMENTATION

      See Also:
        Constant Field Values

    - #### COPY_SEGMENTED_CONTENT

          static final int COPY_SEGMENTED_CONTENT

      See Also:
        Constant Field Values

    - #### COPY_ALL

          static final int COPY_ALL

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getId

          java.lang.String getId()

      Gets the identifier of the resource. This identifier is unique per extracted document and by type of resource. This value is filter-specific. It and may be different from one extraction of the same document to the next. It can a sequential number or not, incremental or not, and it can be not a number. It has no correspondence in the source document ("IDs" coming from the source document are "names" and not available for all resources).
      Returns:
        the identifier of this resource.

    - #### setId

          void setId(java.lang.String id)

      Sets the identifier of this resource.
      Parameters:
        `id` - the new identifier value.
      See Also:
        `getId()`

    - #### getSkeleton

          ISkeleton getSkeleton()

      Gets the skeleton object for this resource.
      Returns:
        the skeleton object for this resource or null if there is none.

    - #### setSkeleton

          void setSkeleton(ISkeleton skeleton)

      Sets the skeleton object for this resource.
      Parameters:
        `skeleton` - the skeleton object to set.

    - #### getAnnotation

          <A extends IAnnotation> A getAnnotation(java.lang.Class<A> annotationType)

      Gets the annotation object for a given class for this resource.
      Parameters:
        `annotationType` - the class of the annotation object to retrieve.
      Returns:
        the annotation for the given class for this resource.

    - #### setAnnotation

          void setAnnotation(IAnnotation annotation)

      Sets an annotation object for this resource.
      Parameters:
        `annotation` - the annotation object to set.

    - #### getAnnotations

          java.lang.Iterable<IAnnotation> getAnnotations()

      Gets the iterable list of the annotations for this resource.
      Returns:
        the iterable list of the annotations for this resource.