Class BslStringLiteralUtil


  • public final class BslStringLiteralUtil
    extends Object
    This class contains useful method for formatting content of the StringLiteral.
    Restriction:
    This class is not intended to be extended by clients.
    • Field Detail

      • STRING_LITERAL_REFERENCE_OFFSET_SHIFT

        public static final int STRING_LITERAL_REFERENCE_OFFSET_SHIFT
        This number determinates that IReferenceDescription.getIndexInList() contains offset of the reference in StringLiteral. If IReferenceDescription.getIndexInList() less than this constant that means IReferenceDescription.getIndexInList() is number part of content of literal divided by dot. If IReferenceDescription.getIndexInList() more than this constant that means IReferenceDescription.getIndexInList() is offset of reference. Offset from beginning of Module: offset = IReferenceDescription.getIndexInList() - STRING_LITERAL_REFERENCE_OFFSET_SHIFT
        See Also:
        Constant Field Values
    • Method Detail

      • formatForStringLiteral

        public static String formatForStringLiteral​(String content,
                                                    int offset,
                                                    org.eclipse.jface.text.IDocument doc,
                                                    String lineSeparator)
        Transform text to the StringLiteral content in Bsl module
        Parameters:
        content - transforming content, can't be null
        offset - beginning position of the tranforming text in IDocument
        doc - IDocument of the transforming StringLiteral content, can't be null
        lineSeparator - line separator to use, can't be null
        Returns:
        text of the StringLiteral with service symbols "|", never null