Class ExtensionsWriter


  • public class ExtensionsWriter
    extends Object
    Provides the methods to output extended elements and attributes.
    • Constructor Detail

      • ExtensionsWriter

        public ExtensionsWriter()
        Creates a ExtensionsWriter that use the current platform line-break.
      • ExtensionsWriter

        public ExtensionsWriter​(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​(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 String buildExtChildren​(List<IExtChild> list,
                                       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 String buildExtElements​(IWithExtElements parent,
                                       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 String buildExtAttributes​(ExtAttributes attributes,
                                         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.