Package com._1c.g5.v8.dt.bsl.common
Class DefaultStringLiteralTextProvider
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.common.DefaultStringLiteralTextProvider
-
- All Implemented Interfaces:
IStringLiteralTextProvider
public class DefaultStringLiteralTextProvider extends Object implements IStringLiteralTextProvider
Default implementation ofIStringLiteralTextProvider
for one sourceStringLiteral
-
-
Constructor Summary
Constructors Constructor Description DefaultStringLiteralTextProvider(StringLiteral literal)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.xtext.util.Pair<StringLiteral,Integer>
getLocation(int offset)
Gets correspondence between location in text returned byIStringLiteralTextProvider.getText()
and location in concreteStringLiteral
Collection<StringLiteral>
getSourceStringLiterals()
Gets all sources forIStringLiteralTextProvider.getText()
StringLiteral
sString
getText()
Gets text corresponding to theStringLiteral
or concatenation ofStringLiteral
s
-
-
-
Constructor Detail
-
DefaultStringLiteralTextProvider
public DefaultStringLiteralTextProvider(StringLiteral literal)
Constructor- Parameters:
literal
- sourceStringLiteral
for getting text, cannot benull
-
-
Method Detail
-
getText
public String getText()
Description copied from interface:IStringLiteralTextProvider
Gets text corresponding to theStringLiteral
or concatenation ofStringLiteral
s- Specified by:
getText
in interfaceIStringLiteralTextProvider
- Returns:
- text corresponding to the
StringLiteral
or concatenation ofStringLiteral
s. This text should not have special Bsl language symbols as '|'. Nevernull
-
getLocation
public org.eclipse.xtext.util.Pair<StringLiteral,Integer> getLocation(int offset)
Description copied from interface:IStringLiteralTextProvider
Gets correspondence between location in text returned byIStringLiteralTextProvider.getText()
and location in concreteStringLiteral
- Specified by:
getLocation
in interfaceIStringLiteralTextProvider
- Parameters:
offset
- offset in text returned byIStringLiteralTextProvider.getText()
- Returns:
StringLiteral
and offset in it corresponding to the offset inIStringLiteralTextProvider.getText()
, can benull
if offset is less zero or more or equals thenIStringLiteralTextProvider.getText()
length
-
getSourceStringLiterals
public Collection<StringLiteral> getSourceStringLiterals()
Description copied from interface:IStringLiteralTextProvider
Gets all sources forIStringLiteralTextProvider.getText()
StringLiteral
s- Specified by:
getSourceStringLiterals
in interfaceIStringLiteralTextProvider
- Returns:
- sources for
IStringLiteralTextProvider.getText()
, collection nevernull
, never empty, Collection can have more the oneStringLiteral
if thisIStringLiteralTextProvider
correspondence to the concatenation ofStringLiteral
-
-