| org.eclipse.jface.text.source.translation.ITranslator
All known Subclasses: org.eclipse.jsp.JspTranslator,
ITranslator | public interface ITranslator (Code) | | A translator translates a given file into another language.
The translator is also responsible to provide line mapping
information for the translation and to compute which offset
in an original line corresponds to a given offset in a
target line.
since: 3.0 |
Method Summary | |
int | backTranslateOffsetInLine(String sourceLine, String translatedLine, int offsetInTranslatedLine, String tag) Computes the offset in the source line that corresponds
to the given offset in the translated line. | int[] | getLineMapping() Returns the line mapping information. | void | setTagHandlerFactory(ITagHandlerFactory tagHandlerFactory) Assigns an optional tag handler factory to this translator.
A translator can delegate the handling of individual tags
to tag handlers. | String | translate(Reader reader, String name) Reads the source from the given reader and creates
translates it into another language. |
backTranslateOffsetInLine | int backTranslateOffsetInLine(String sourceLine, String translatedLine, int offsetInTranslatedLine, String tag)(Code) | | Computes the offset in the source line that corresponds
to the given offset in the translated line.
Parameters: sourceLine - the source line Parameters: translatedLine - the translated line Parameters: offsetInTranslatedLine - the offset in the translated line Parameters: tag - the tag to which the source line belongs ornull if the tag is not known the offset in the source line or -1 ifit was not possible to compute the offset |
getLineMapping | int[] getLineMapping()(Code) | | Returns the line mapping information.
an int array where the index corresponds to linenumbers in the translation and the value is asource line number |
setTagHandlerFactory | void setTagHandlerFactory(ITagHandlerFactory tagHandlerFactory)(Code) | | Assigns an optional tag handler factory to this translator.
A translator can delegate the handling of individual tags
to tag handlers. The factory is responsible to provide
the correct tag handlers.
Parameters: tagHandlerFactory - a tag handler factory or null if this translator does all work itself |
translate | String translate(Reader reader, String name) throws IOException(Code) | | Reads the source from the given reader and creates
translates it into another language. The translated
source might be given the optional name.
Parameters: reader - the reader to access the source Parameters: name - the name of the translated source or null if none throws: IOException - |
|
|