net.sf.okapi.common.resource

## Interface INameable

- All Superinterfaces:
    IResource, IWithAnnotations, IWithBilingualProperties, IWithProperties
  All Known Subinterfaces:
    ITextUnit
  All Known Implementing Classes:
    BaseNameable, BaseReferenceable, DocumentPart, StartDocument, StartGroup, StartSubDocument, StartSubfilter, StorageList, TextContainer, TextUnit

      public interface INameable
      extends IWithProperties, IWithBilingualProperties, IWithAnnotations, IResource

  Provides the methods common to all resources that can be named and have properties.

- - ### Field Summary

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

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

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Property` | `createTargetProperty(LocaleId locId, java.lang.String name, boolean overwriteExisting, int creationOptions)` Creates or get a target property based on the corresponding source.
    `java.lang.String` | `getMimeType()` Gets the type of content of this resource.
    `java.lang.String` | `getName()` Gets the name of this resource.
    `java.lang.String` | `getType()` Gets the type information associated with this resource.
    `boolean` | `isTranslatable()` Indicates if the content of this resource is translatable.
    `boolean` | `preserveWhitespaces()` Indicates if the white-spaces in the content of this resource should be preserved.
    `void` | `setIsTranslatable(boolean value)` Sets the flag indicating if the content of this resource is translatable.
    `void` | `setMimeType(java.lang.String value)` Sets the type of content of this resource.
    `void` | `setName(java.lang.String name)` Sets the name of this resource.
    `void` | `setPreserveWhitespaces(boolean value)` sets the flag indicating if the white-spaces in the content of this resource should be preserved.
    `void` | `setType(java.lang.String value)` Sets the type information associated with this resource.

    - ### Methods inherited from interface net.sf.okapi.common.resource.IWithProperties

      `getProperty, getPropertyNames, hasProperty, removeProperty, setProperty`

    - ### Methods inherited from interface net.sf.okapi.common.resource.IWithBilingualProperties

      `getSourceProperty, getSourcePropertyNames, getTargetLocales, getTargetProperty, getTargetPropertyNames, hasSourceProperty, hasTargetProperty, removeSourceProperty, removeTargetProperty, setSourceProperty, setTargetProperty`

    - ### Methods inherited from interface net.sf.okapi.common.resource.IWithAnnotations

      `getAnnotation, getAnnotations, setAnnotation`

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

      `getId, getSkeleton, setId, setSkeleton`

- - ### Method Detail

    - #### getName

          java.lang.String getName()

      Gets the name of this resource. The resource name corresponds to different things depending on the type of resource. For a StartDocument the name is the URI of the document. Otherwise, in most cases the name is the identifier of the resource (This is the equivalent of the XLIFF resname attribute).
      Returns:
        This resource name, or null if there is none.

    - #### setName

          void setName(java.lang.String name)

      Sets the name of this resource. The resource name is the equivalent of the XLIFF resname attribute.
      Parameters:
        `name` - New name to set.

    - #### getType

          java.lang.String getType()

      Gets the type information associated with this resource. For example "button".
      Returns:
        The type information associated with this resource.

    - #### setType

          void setType(java.lang.String value)

      Sets the type information associated with this resource. For example "button".
      Parameters:
        `value` - The new type information.

    - #### getMimeType

          java.lang.String getMimeType()

      Gets the type of content of this resource. For example "text/xml".
      Returns:
        The type of content of this resource.

    - #### setMimeType

          void setMimeType(java.lang.String value)

      Sets the type of content of this resource. For example "text/xml".
      Parameters:
        `value` - The new type of content of this resource.

    - #### createTargetProperty

          Property createTargetProperty(LocaleId locId,
                                        java.lang.String name,
                                        boolean overwriteExisting,
                                        int creationOptions)

      Creates or get a target property based on the corresponding source.
      Parameters:
        `locId` - The target locale to use.
        `name` - The name of the property to create (or retrieve)
        `overwriteExisting` - True to overwrite any existing property. False to not create a new property if one exists already.
        `creationOptions` - Creation options:
        - CREATE_EMPTY: Creates an empty property, only the read-only flag of the source is copied.
        - COPY_CONTENT: Creates a new property with all its data copied from the source.
      Returns:
        The property that was created, or retrieved.

    - #### isTranslatable

          boolean isTranslatable()

      Indicates if the content of this resource is translatable. By default this indicator is set to true for all resources.
      Returns:
        True if the content of this resource is translatable. False if it is not translatable.

    - #### setIsTranslatable

          void setIsTranslatable(boolean value)

      Sets the flag indicating if the content of this resource is translatable.
      Parameters:
        `value` - True to indicate that the content of this resource is translatable.

    - #### preserveWhitespaces

          boolean preserveWhitespaces()

      Indicates if the white-spaces in the content of this resource should be preserved. By default this indicator is set to false for all resources.
      Returns:
        True if the white-spaces in the content of this resource should be preserved.

    - #### setPreserveWhitespaces

          void setPreserveWhitespaces(boolean value)

      sets the flag indicating if the white-spaces in the content of this resource should be preserved.
      Parameters:
        `value` - True to indicate that the white-spaces in the content of this resource should be preserved.