Package net.sf.okapi.lib.xliff2.writer
Class ExtensionsWriter
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.writer.ExtensionsWriter
-
public class ExtensionsWriter extends Object
Provides the methods to output extended elements and attributes.
-
-
Constructor Summary
Constructors Constructor Description ExtensionsWriter()Creates aExtensionsWriterthat use the current platform line-break.ExtensionsWriter(String lineBreak)Creates aExtensionsWriterand sets the type of line-breaks to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbuildExtAttributes(ExtAttributes attributes, Stack<NSContext> nsStack)Builds the XLIFF output for a givebExtAttributesobject.StringbuildExtChildren(List<IExtChild> list, Stack<NSContext> nsStack)Builds the XLIFF output for a given list ofIExtChildobjects.StringbuildExtElements(IWithExtElements parent, Stack<NSContext> nsStack)Builds the XLIFF output for a given object that has extension objects.voidsetLineBreak(String lineBreak)Sets the line break to use for this document.
-
-
-
Constructor Detail
-
ExtensionsWriter
public ExtensionsWriter()
Creates aExtensionsWriterthat use the current platform line-break.
-
ExtensionsWriter
public ExtensionsWriter(String lineBreak)
Creates aExtensionsWriterand 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 thecreate()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 ofIExtChildobjects.- 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 givebExtAttributesobject.- 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.
-
-