Package net.sf.okapi.filters.xliff2.util
Class NotesMapper
- java.lang.Object
-
- net.sf.okapi.filters.xliff2.util.NotesMapper
-
public class NotesMapper extends Object
Saves properties from the XLIFF Toolkit into Okapi Core and back. The properties saved involve primarily attributes, and other data that does not fit neatly within the Okapi Core Pipeline structure.Since the operation to and from should be equivalent, we put both operations in here to make it easier to compare them.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
setAnnotations(IWithNotes sourceXliffNotesHolder, IWithAnnotations targetAnnotationsHolder)
Takes notes from XLIFF 2.0 and stores them as Okapi Core Annotationsstatic void
setNotes(IWithAnnotations sourceAnnotationsHolder, IWithNotes targetXliffNotesHolder)
Takes annotations from Okapi Core and stores them as XLIFF 2.0 notesstatic void
setNotes(IWithAnnotations sourceAnnotationsHolder, StartFileData targetStartFileData)
A placeholder to give a warning if annotations are detected in theStartSubDocument
.
-
-
-
Method Detail
-
setNotes
public static void setNotes(IWithAnnotations sourceAnnotationsHolder, IWithNotes targetXliffNotesHolder)
Takes annotations from Okapi Core and stores them as XLIFF 2.0 notes- Parameters:
sourceAnnotationsHolder
- The source of the annotations.targetXliffNotesHolder
- The destination where the notes will be stored.
-
setAnnotations
public static void setAnnotations(IWithNotes sourceXliffNotesHolder, IWithAnnotations targetAnnotationsHolder)
Takes notes from XLIFF 2.0 and stores them as Okapi Core Annotations- Parameters:
sourceXliffNotesHolder
- The source of the notes.targetAnnotationsHolder
- The destination to store the annotations
-
setNotes
public static void setNotes(IWithAnnotations sourceAnnotationsHolder, StartFileData targetStartFileData)
A placeholder to give a warning if annotations are detected in theStartSubDocument
. If theStartSubDocument
has some annotations, they will be lost and a warning will be logged. TheStartFileData
class from the XLIFF Toolkit does not implementIWithNotes
, instead the notes in a <file> element are stored inMidFileData
. In a future update we could potentially transfer the annotations from theStartSubDocument
to theMidFileData
.- Parameters:
sourceAnnotationsHolder
- The source of the notes.targetStartFileData
- The destination where Notes are attempting to be stored
-
-