net.sf.okapi.common.resource

## Class Document

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

- All Implemented Interfaces:
    java.lang.Iterable<IResource>, IResource

      public class Document
      extends java.lang.Object
      implements IResource, java.lang.Iterable<IResource>

  UNUSED class.

- - ### Field Summary

    - ### Fields inherited from interface net.sf.okapi.common.IResource

      `COPY_ALL, COPY_CONTENT, COPY_PROPERTIES, COPY_SEGMENTATION, COPY_SEGMENTED_CONTENT, CREATE_EMPTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Document()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addResource(IResource resource)`
    `<A extends IAnnotation> A` | `getAnnotation(java.lang.Class<A> annotationType)` Gets the annotation object for a given class for this resource.
    `Annotations` | `getAnnotations()` Gets the iterable list of the annotations for this resource.
    `java.lang.String` | `getId()` Gets the identifier of the resource.
    `ISkeleton` | `getSkeleton()` Always throws an exception as there is never a skeleton associated to a RawDocument.
    `java.util.Iterator<IResource>` | `iterator()`
    `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)` This method has no effect as there is never a skeleton for a Document.

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

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

- - ### Constructor Detail

    - #### Document

          public Document()

  - ### Method Detail

    - #### addResource

          public void addResource(IResource resource)

    - #### getAnnotation

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

      Description copied from interface: `IResource`
      Gets the annotation object for a given class for this resource.
      Specified by:
        `getAnnotation` in interface `IResource`
      Parameters:
        `annotationType` - the class of the annotation object to retrieve.
      Returns:
        the annotation for the given class for this resource.

    - #### getId

          public java.lang.String getId()

      Description copied from interface: `IResource`
      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).
      Specified by:
        `getId` in interface `IResource`
      Returns:
        the identifier of this resource.

    - #### getSkeleton

          public ISkeleton getSkeleton()

      Always throws an exception as there is never a skeleton associated to a RawDocument.
      Specified by:
        `getSkeleton` in interface `IResource`
      Returns:
        never returns.
      Throws:
        `OkapiNotImplementedException`

    - #### setAnnotation

          public void setAnnotation(IAnnotation annotation)

      Description copied from interface: `IResource`
      Sets an annotation object for this resource.
      Specified by:
        `setAnnotation` in interface `IResource`
      Parameters:
        `annotation` - the annotation object to set.

    - #### setId

          public void setId(java.lang.String id)

      Description copied from interface: `IResource`
      Sets the identifier of this resource.
      Specified by:
        `setId` in interface `IResource`
      Parameters:
        `id` - the new identifier value.
      See Also:
        `IResource.getId()`

    - #### setSkeleton

          public void setSkeleton(ISkeleton skeleton)

      This method has no effect as there is never a skeleton for a Document.
      Specified by:
        `setSkeleton` in interface `IResource`
      Parameters:
        `skeleton` - the skeleton object to set.
      Throws:
        `OkapiNotImplementedException`

    - #### iterator

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

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

    - #### getAnnotations

          public Annotations getAnnotations()

      Description copied from interface: `IResource`
      Gets the iterable list of the annotations for this resource.
      Specified by:
        `getAnnotations` in interface `IResource`
      Returns:
        the iterable list of the annotations for this resource.