net.sf.okapi.common.resource

## Class StartDocument

- java.lang.Object
- - net.sf.okapi.common.resource.BaseNameable
  - - net.sf.okapi.common.resource.StartDocument

- All Implemented Interfaces:
    IResource, INameable

      public class StartDocument
      extends BaseNameable

  Resource associated with the filter event START_DOCUMENT.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `encoding`
    `protected IFilterWriter` | `filterWriter`
    `protected boolean` | `hasUTF8BOM`
    `protected boolean` | `isMultilingual`
    `protected java.lang.String` | `lineBreak`
    `protected LocaleId` | `locale`
    `protected IParameters` | `params`

    - ### Fields inherited from class net.sf.okapi.common.resource.BaseNameable

      `annotations, id, isTranslatable, mimeType, name, preserveWS, properties, skeleton, sourceProperties, type`

    - ### 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
    `StartDocument(java.lang.String id)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getEncoding()` Gets the character set encoding of this document.
    `IParameters` | `getFilterParameters()` Gets the current parameters for this document.
    `IFilterWriter` | `getFilterWriter()` Gets the filter writer for this document.
    `java.lang.String` | `getLineBreak()` Gets the type of line-break used in the original document.
    `LocaleId` | `getLocale()` Gets the locale of this document.
    `boolean` | `hasUTF8BOM()` Indicates if this document is encoded as UTF8 and has a Byte-Order-Mark.
    `boolean` | `isMultilingual()` Indicates if this document is multilingual.
    `void` | `setEncoding(java.lang.String encoding, boolean hasUTF8BOM)` Sets the character set encoding of this document.
    `void` | `setFilterParameters(IParameters params)` Sets the parameters for this document.
    `void` | `setFilterWriter(IFilterWriter filterWriter)` Sets the filter writer for this document.
    `void` | `setLineBreak(java.lang.String value)` Sets the type of line-break used in the original document.
    `void` | `setLocale(LocaleId locale)` Sets the locale of the document.
    `void` | `setMultilingual(boolean value)` Sets the flag that indicates if this document is multilingual.

    - ### Methods inherited from class net.sf.okapi.common.resource.BaseNameable

      `createTargetProperty, getAnnotation, getAnnotations, getId, getMimeType, getName, getProperty, getPropertyNames, getSkeleton, getSourceProperty, getSourcePropertyNames, getTargetLocales, getTargetProperty, getTargetPropertyNames, getType, hasProperty, hasSourceProperty, hasTargetProperty, isTranslatable, preserveWhitespaces, removeProperty, removeSourceProperty, removeTargetProperty, setAnnotation, setId, setIsTranslatable, setMimeType, setName, setPreserveWhitespaces, setProperty, setSkeleton, setSourceProperty, setTargetProperty, setType`

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

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

- - ### Field Detail

    - #### locale

          protected LocaleId locale

    - #### encoding

          protected java.lang.String encoding

    - #### isMultilingual

          protected boolean isMultilingual

    - #### params

          protected IParameters params

    - #### filterWriter

          protected IFilterWriter filterWriter

    - #### hasUTF8BOM

          protected boolean hasUTF8BOM

    - #### lineBreak

          protected java.lang.String lineBreak

  - ### Constructor Detail

    - #### StartDocument

          public StartDocument(java.lang.String id)

  - ### Method Detail

    - #### getLocale

          public LocaleId getLocale()

      Gets the locale of this document. If the document is multilingual this is the source locale.
      Returns:
        the (source) locale of the document.

    - #### setLocale

          public void setLocale(LocaleId locale)

      Sets the locale of the document. If the document is multilingual this is the source locale.
      Parameters:
        `locale` - (source) locale of the document.

    - #### getEncoding

          public java.lang.String getEncoding()

      Gets the character set encoding of this document. For example "UTF-8"
      Returns:
        the string identifying the character set of this document.

    - #### setEncoding

          public void setEncoding(java.lang.String encoding,
                         boolean hasUTF8BOM)

      Sets the character set encoding of this document.
      Parameters:
        `encoding` - The string identifying the character set encoding of this document. For example "UTF-8".
        `hasUTF8BOM` - true if this document is UTf-8 and has a Byte-Order-Mark. False in all other cases.

    - #### isMultilingual

          public boolean isMultilingual()

      Indicates if this document is multilingual.
      Returns:
        true if this document is multilingual, false otherwise.

    - #### setMultilingual

          public void setMultilingual(boolean value)

      Sets the flag that indicates if this document is multilingual.
      Parameters:
        `value` - true to set this document as multilingual, false to set it as monolingual.

    - #### hasUTF8BOM

          public boolean hasUTF8BOM()

      Indicates if this document is encoded as UTF8 and has a Byte-Order-Mark.
      Returns:
        true if this document is encoded as UTF8 and has a Byte-Order-Mark. False if the document is not encoded in UTF-8 or if if it is encoded in UTF-8 and has not a Byte-Order-Mark.

    - #### getLineBreak

          public java.lang.String getLineBreak()

      Gets the type of line-break used in the original document.
      Returns:
        the type of line-break used in the original document.

    - #### setLineBreak

          public void setLineBreak(java.lang.String value)

      Sets the type of line-break used in the original document.
      Parameters:
        `value` - the type of line-break of the original document, for example: "\r\n" (for Windows/DOS line-break).

    - #### getFilterWriter

          public IFilterWriter getFilterWriter()

      Gets the filter writer for this document.
      Returns:
        the filter writer for this document.

    - #### setFilterWriter

          public void setFilterWriter(IFilterWriter filterWriter)

      Sets the filter writer for this document.
      Parameters:
        `filterWriter` - the filter writer for this document.

    - #### getFilterParameters

          public IParameters getFilterParameters()

      Gets the current parameters for this document.
      Returns:
        the object containing the parameters for this document.

    - #### setFilterParameters

          public void setFilterParameters(IParameters params)

      Sets the parameters for this document.
      Parameters:
        `params` - the object containing the parameters for this document.