public abstract class ParseEntry extends java.lang.Object implements IParseCallback
Modifier and Type | Class and Description |
---|---|
protected static class |
ParseEntry.ParseEntryQueueItem
Storage for collected segments.
|
static class |
ParseEntry.ParseEntryResult
Storage for results of entry parsing, i.e.
|
Constructor and Description |
---|
ParseEntry(ProjectProperties conf) |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(java.lang.String id,
java.lang.String source,
java.lang.String translation,
boolean isFuzzy,
java.lang.String comment,
IFilter filter)
This method is called by filters to add new entry in OmegaT after read it from source file.
|
void |
addEntry(java.lang.String id,
java.lang.String source,
java.lang.String translation,
boolean isFuzzy,
java.lang.String comment,
java.lang.String path,
IFilter filter,
java.util.List<ProtectedPart> protectedParts)
This method is called by filters to add new entry in OmegaT after read it from source file.
|
void |
addEntryWithProperties(java.lang.String id,
java.lang.String source,
java.lang.String translation,
boolean isFuzzy,
java.lang.String[] props,
java.lang.String path,
IFilter filter,
java.util.List<ProtectedPart> protectedParts)
This method is called by filters to add new entry in OmegaT after read it from source file.
|
protected abstract void |
addSegment(java.lang.String id,
short segmentIndex,
java.lang.String segmentSource,
java.util.List<ProtectedPart> protectedParts,
java.lang.String segmentTranslation,
boolean segmentTranslationFuzzy,
java.lang.String[] props,
java.lang.String prevSegment,
java.lang.String nextSegment,
java.lang.String path)
Adds a segment to the project.
|
protected void |
fileFinished() |
void |
linkPrevNextSegments()
This method can be called from any filter on the end of file processing.
|
protected void |
setCurrentFile(IProject.FileInfo fi) |
static java.lang.String |
stripSomeChars(java.lang.String src,
ParseEntry.ParseEntryResult per,
boolean removeTags,
boolean removeSpaces)
Strip some chars for represent string in UI.
|
public ParseEntry(ProjectProperties conf)
protected void setCurrentFile(IProject.FileInfo fi)
protected void fileFinished()
public void linkPrevNextSegments()
linkPrevNextSegments
in interface IParseCallback
public void addEntryWithProperties(java.lang.String id, java.lang.String source, java.lang.String translation, boolean isFuzzy, java.lang.String[] props, java.lang.String path, IFilter filter, java.util.List<ProtectedPart> protectedParts)
addEntryWithProperties
in interface IParseCallback
id
- ID of entry, if format supports itsource
- Translatable source stringtranslation
- translation of the source string, if format supports itisFuzzy
- flag for fuzzy translation. If a translation is fuzzy, it is not added to the projects TMX,
but it is added to the generated 'reference' TMX, a special TMX that is used as extra
reference during translation.props
- a staggered array of non-uniquely-identifying key=value properties (metadata) for the entry.
If property is org.omegat.core.data.SegmentProperties.REFERENCE, the entire segment is added only to
the generated 'reference' TMX, a special TMX that is used as extra reference during translation.
The segment is not added to the list of translatable segments.
Property can also be org.omegat.core.data.SegmentProperties.COMMENT, which shown in the comment panel.
Other properties are possible, but have no special meaning in OmegaT.path
- path of entry in filefilter
- filter which produces entryprotectedParts
- protected partspublic void addEntry(java.lang.String id, java.lang.String source, java.lang.String translation, boolean isFuzzy, java.lang.String comment, java.lang.String path, IFilter filter, java.util.List<ProtectedPart> protectedParts)
Old call for filters that only support extracting a "comment" property. Kept for compatibility.
addEntry
in interface IParseCallback
public void addEntry(java.lang.String id, java.lang.String source, java.lang.String translation, boolean isFuzzy, java.lang.String comment, IFilter filter)
Old call without path, for compatibility. Comment is converted to a property.
addEntry
in interface IParseCallback
id
- ID of entry, if format supports itsource
- Translatable source stringtranslation
- translation of the source string, if format supports itisFuzzy
- flag for fuzzy translation. If a translation is fuzzy, it is not added to the projects TMX,
but it is added to the generated 'reference' TMX, a special TMX that is used as extra
reference during translation.comment
- entry's comment, if format supports itfilter
- filter which produces entryprotected abstract void addSegment(java.lang.String id, short segmentIndex, java.lang.String segmentSource, java.util.List<ProtectedPart> protectedParts, java.lang.String segmentTranslation, boolean segmentTranslationFuzzy, java.lang.String[] props, java.lang.String prevSegment, java.lang.String nextSegment, java.lang.String path)
id
- ID of entry, if format supports itsegmentIndex
- Number of the segment-part of the original source string.segmentSource
- Translatable source stringprotectedParts
- protected partssegmentTranslation
- translation of the source string, if format supports itsegmentTranslationFuzzy
- fuzzy flag of translation of the source string, if format
supports itprops
- entry's properties, like comments, if format supports itprevSegment
- previous segment's textnextSegment
- next segment's textpath
- path of segmentpublic static java.lang.String stripSomeChars(java.lang.String src, ParseEntry.ParseEntryResult per, boolean removeTags, boolean removeSpaces)
src
- source string to strip chars