Class BslCommentUtils
- java.lang.Object
- 
- com._1c.g5.v8.dt.bsl.documentation.comment.BslCommentUtils
 
- 
 public final class BslCommentUtils extends Object Parser for Bsl format comments
- 
- 
Field SummaryFields Modifier and Type Field Description static StringSTART_COMMENT_TAG_BSLComment tag string constant
 - 
Constructor SummaryConstructors Constructor Description BslCommentUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]getCommentLineLocalOffsets(List<org.eclipse.xtext.nodemodel.INode> commentLines, Method method)Gets offsets of each line in comment relatively to the total method textstatic BslDocumentationCommentgetLinkPartCommentContent(LinkPart linkPart, org.eclipse.xtext.scoping.IScopeProvider scopeProvider, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext)GetsBslDocumentationCommentfrom Bsl method provided byLinkPartstatic List<String>getModuleCommentsBeforeFirstSemanticElement(Module module, BslMultiLineCommentDocumentationProvider commentProvider)Returns the list of module's comments residing before the first symantic element.static org.eclipse.emf.ecore.EObjectgetObjectByLinkPart(LinkPart linkPart, org.eclipse.xtext.scoping.IScopeProvider scopeProvider, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext)GetsEObjectprovided byLinkPartstatic booleanisCommentNode(org.eclipse.xtext.nodemodel.ILeafNode leafNode)ChecksILeafNodeis comment node in Bsl grammarstatic booleanisDeprecated(Method method)Checks in fast way that method is deprecated.static BslDocumentationCommentparseTemplateComment(BslContextDefMethod method, boolean oldFormat)Parses Built-In language documentation comment for theBslContextDefMethodstatic BslDocumentationCommentparseTemplateComment(Method method, boolean oldFormat, BslMultiLineCommentDocumentationProvider commentProvider)Parses Built-In language documentation comment for theMethodstatic BslDocumentationCommentparseTemplateComment(List<String> templateLines, boolean oldFormat)Parses Bsl documentation comment from text linesstatic BslDocumentationCommentparseTemplateComment(List<String> templateLines, Method method, boolean oldFormat)Parses Bsl documentation comment from text linesstatic List<org.eclipse.xtext.util.Pair<String,Integer>>split(String text, String symbol)Splits text by special patternstatic List<org.eclipse.xtext.util.Pair<String,Integer>>split(String text, String symbol, int partLimit)Splits text by special patternstatic org.eclipse.xtext.util.Triple<String,Integer,Integer>trim(String text)Trims initial text
 
- 
- 
- 
Field Detail- 
START_COMMENT_TAG_BSLpublic static final String START_COMMENT_TAG_BSL Comment tag string constant- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
parseTemplateCommentpublic static BslDocumentationComment parseTemplateComment(Method method, boolean oldFormat, BslMultiLineCommentDocumentationProvider commentProvider) Parses Built-In language documentation comment for theMethod- Parameters:
- method-- Methodwith documentation comment, cannot be- null
- oldFormat-- trueif parsing in old documentation comment format,- falseif in new format
- commentProvider- special- BslMultiLineCommentDocumentationProviderfor getting comment- INode, cannot be- null
- Returns:
- Built-In language documentation comment for the Method, nevernull, if there is no comment nodes emptyBslDocumentationCommentwill be returned
 
 - 
parseTemplateCommentpublic static BslDocumentationComment parseTemplateComment(BslContextDefMethod method, boolean oldFormat) Parses Built-In language documentation comment for theBslContextDefMethod- Parameters:
- method-- BslContextDefMethodcontains content of the documentation comment adn offsets of the each line in comment relatively to the total method text, cannot be- null
- oldFormat-- trueif parsing in old documentation comment format,- falseif in new format
- Returns:
- Built-In language documentation comment for the BslContextDefMethod, nevernull, if there is no comment emptyBslDocumentationCommentwill be returned
 
 - 
parseTemplateCommentpublic static BslDocumentationComment parseTemplateComment(List<String> templateLines, Method method, boolean oldFormat) Parses Bsl documentation comment from text lines- Parameters:
- templateLines- text lines with comment information, cannnot be- null
- method- method- Methodwith documentation comment, cannot be- null
- oldFormat-- trueif parsing in old documentation comment format,- falseif in new format
- Returns:
- Bsl documentation comment for the Method, nevernull, if there is empty text linesBslDocumentationCommentwill be returned
 
 - 
parseTemplateCommentpublic static BslDocumentationComment parseTemplateComment(List<String> templateLines, boolean oldFormat) Parses Bsl documentation comment from text lines- Parameters:
- templateLines- text lines with comment information, cannnot be- null
- method- method- Methodwith documentation comment, cannot be- null
- oldFormat-- trueif parsing in old documentation comment format,- falseif in new format
- Returns:
- Bsl documentation comment for the Method, nevernull, if there is empty text linesBslDocumentationCommentwill be returned
 
 - 
isCommentNodepublic static boolean isCommentNode(org.eclipse.xtext.nodemodel.ILeafNode leafNode) ChecksILeafNodeis comment node in Bsl grammar- Parameters:
- leafNode- checking node, cannot be- null
- Returns:
- trueif node is Bsl comment node,- falseotherwise
 
 - 
isDeprecatedpublic static boolean isDeprecated(Method method) Checks in fast way that method is deprecated. Method is deprecated when the first its comment line starts withIBslCommentToken.DEPRECATEDorIBslCommentToken.DEPRECATED_RU
 - 
splitpublic static List<org.eclipse.xtext.util.Pair<String,Integer>> split(String text, String symbol) Splits text by special pattern- Parameters:
- text- splitting text, cannot be- null
- symbol- pattern for spliting, this pattern found in- textwith- String.indexOf(int), cannot be- null
- Returns:
- collection of the text part devided be symboland offset of the each part in the originaltext, cannot benull, this collection doesnnot contains part with 0 length
 
 - 
splitpublic static List<org.eclipse.xtext.util.Pair<String,Integer>> split(String text, String symbol, int partLimit) Splits text by special pattern- Parameters:
- text- splitting text, cannot be- null
- symbol- pattern for spliting, this pattern found in- textwith- String.indexOf(int), cannot be- null
- partLimit- limit of max splitted parts.
- Returns:
- collection of the text part devided be symboland offset of the each part in the originaltext, cannot benull, this collection does not contains part with 0 length. Count of parts cannot be more thancountOfParts
 
 - 
trimpublic static org.eclipse.xtext.util.Triple<String,Integer,Integer> trim(String text) Trims initial text- Parameters:
- text- triming text, cannot be- null
- Returns:
- initial textwithout symbols from begining and ending corresponding to theCharacter.isWhitespace(char), and length of the trimming substrings from begining and ending
 
 - 
getLinkPartCommentContentpublic static BslDocumentationComment getLinkPartCommentContent(LinkPart linkPart, org.eclipse.xtext.scoping.IScopeProvider scopeProvider, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext) GetsBslDocumentationCommentfrom Bsl method provided byLinkPart- Parameters:
- linkPart-- LinkPartlinks to- Method, cannot be- null
- scopeProvider- actual- IScopeProviderfor getting index object, cannot be- null
- commentProvider- actual- BslMultiLineCommentDocumentationProviderfor getting method documentation comment content, cannot be- null
- oldFormat-- trueif using old format of documentation comment,- falseotherwise
- context- context object for resolving index object from- scopeProvider, cannot be- null
- typeComputationContext- Type system computation context. May not be- null
- Returns:
 
 - 
getObjectByLinkPartpublic static org.eclipse.emf.ecore.EObject getObjectByLinkPart(LinkPart linkPart, org.eclipse.xtext.scoping.IScopeProvider scopeProvider, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext) GetsEObjectprovided byLinkPart- Parameters:
- linkPart- actual- LinkPartfor getting- EObjectby it, cannot be- null
- scopeProvider- actual- IScopeProviderfor getting index object, cannot be- null
- context- context object for resolving index object from- scopeProvider, cannot be- null
- typeComputationContext- Type system computation context. May not be- null
- Returns:
- EObjectprovided by- LinkPartcan be- nullif- LinkPartnot link to real- EObject
 
 - 
getModuleCommentsBeforeFirstSemanticElementpublic static List<String> getModuleCommentsBeforeFirstSemanticElement(Module module, BslMultiLineCommentDocumentationProvider commentProvider) Returns the list of module's comments residing before the first symantic element.- Parameters:
- module- the reference to- Module, cannot be- null
- commentProvider- the reference to- BslMultiLineCommentDocumentationProvider, cannot be- null
- Returns:
- the list of comments or empty list, never null
 
 - 
getCommentLineLocalOffsetspublic static int[] getCommentLineLocalOffsets(List<org.eclipse.xtext.nodemodel.INode> commentLines, Method method) Gets offsets of each line in comment relatively to the total method text- Parameters:
- commentLines-- INodeof document comment lines, cannot be- null
- method-- Methodwith document comment nodes, cannot be- null
- Returns:
- offsets of the each line in comment relatively to the total method text, cannot be null
 
 
- 
 
-