net.sf.okapi.lib.xliff2.writer

## Class ExtensionsWriter

- java.lang.Object
- - net.sf.okapi.lib.xliff2.writer.ExtensionsWriter

-     public class ExtensionsWriter
      extends java.lang.Object

  Provides the methods to output extended elements and attributes.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExtensionsWriter()` Creates a `ExtensionsWriter` that use the current platform line-break.
    `ExtensionsWriter(java.lang.String lineBreak)` Creates a `ExtensionsWriter` and sets the type of line-breaks to use.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `buildExtAttributes(ExtAttributes attributes, java.util.Stack<NSContext> nsStack)` Builds the XLIFF output for a giveb `ExtAttributes` object.
    `java.lang.String` | `buildExtChildren(java.util.List<IExtChild> list, java.util.Stack<NSContext> nsStack)` Builds the XLIFF output for a given list of `IExtChild` objects.
    `java.lang.String` | `buildExtElements(IWithExtElements parent, java.util.Stack<NSContext> nsStack)` Builds the XLIFF output for a given object that has extension objects.
    `void` | `setLineBreak(java.lang.String lineBreak)` Sets the line break to use for this document.

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

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

- - ### Constructor Detail

    - #### ExtensionsWriter

          public ExtensionsWriter()

      Creates a `ExtensionsWriter` that use the current platform line-break.

    - #### ExtensionsWriter

          public ExtensionsWriter(java.lang.String lineBreak)

      Creates a `ExtensionsWriter` and sets the type of line-breaks to use.
      Parameters:
        `lineBreak` - the line-break to use.

  - ### Method Detail

    - #### setLineBreak

          public void setLineBreak(java.lang.String lineBreak)

      Sets the line break to use for this document. You must set this before calling any of the `create()` methods. By default the line-break used is the one of the OS.
      Parameters:
        `lineBreak` - the line break to use for this document.

    - #### buildExtChildren

          public java.lang.String buildExtChildren(java.util.List<IExtChild> list,
                                          java.util.Stack<NSContext> nsStack)

      Builds the XLIFF output for a given list of `IExtChild` objects.
      Parameters:
        `list` - the list to output.
        `nsStack` - the namespace context stack, or null to use a new one with just XLIFF in context.
      Returns:
        the XLIFF representation of the input list.

    - #### buildExtElements

          public java.lang.String buildExtElements(IWithExtElements parent,
                                          java.util.Stack<NSContext> nsStack)

      Builds the XLIFF output for a given object that has extension objects.
      Parameters:
        `parent` - the object with the extension objects.
        `nsStack` - the namespace context stack, or null to use a new one with just XLIFF in context.
      Returns:
        the XLIFF representation of the extension objects.

    - #### buildExtAttributes

          public java.lang.String buildExtAttributes(ExtAttributes attributes,
                                            java.util.Stack<NSContext> nsStack)

      Builds the XLIFF output for a giveb `ExtAttributes` object.
      Parameters:
        `attributes` - the object to output.
        `nsStack` - the namespace context stack, or null to use a new one with just XLIFF in context.
      Returns:
        the XLIFF representation of the extension attributes.