Class BslDocumentationComment
- java.lang.Object
- 
- com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment
 
- 
- All Implemented Interfaces:
- IDescriptionPart
 
 public class BslDocumentationComment extends Object implements IDescriptionPart Class represents the Bsl documentation comment as in new format and in old format. Common description of the documentation comment is://(Deprecated. | Устарела)? Description //(Parameters: | Параметры:) //* parameterName1 ((type section description) | (text description)) //... //* parameterNameN ((type section description) | (text description)) //(Call options: | Варианты вызова:) //text description of the method call options //(Returns: | Возвращаемое значение:) //((type section description) | (text description)) //(Example: | Пример:) //text description of the example of using method ClassBslDocumentationComment.Sectioncorresponding to the each part of comment. Parameters section has special sectionBslDocumentationComment.ParametersSection. Return section has special sectionBslDocumentationComment.ReturnSection. Text part description represents byIDescriptionPart. Type section part represents byTypeSection. Differences between old and new format is little:- keywords "Returns:" replaced to "Return value" in old format
- there is no "*" before parameterName in oldFormat
- differences in type section description - see TypeSection
 IBslCommentToken
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classBslDocumentationComment.DescriptionClass represent description of theBslDocumentationComment.Sectionof the Bsl documentation comment.static classBslDocumentationComment.ParametersSectionClass represents parameter section of the Bsl documentation comment.static classBslDocumentationComment.ReturnSectionClass represents return section of the Bsl documentation comment.static classBslDocumentationComment.SectionClass represents section of the Bsl documentation comment.
 - 
Constructor SummaryConstructors Constructor Description BslDocumentationComment()Empty constructorBslDocumentationComment(BslContextDefMethod method)Constructor byBslContextDefMethodBslDocumentationComment(Module module, Method method, int[] lineLocalOffsets)Constructor
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<TypeItem>computeParameterTypes(String name, org.eclipse.xtext.scoping.IScope typeScope, org.eclipse.xtext.scoping.IScopeProvider scopeProvider, org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext)Computes real types for parameter fromParameterSectionCollection<TypeItem>computeReturnTypes(org.eclipse.xtext.scoping.IScope typeScope, org.eclipse.xtext.scoping.IScopeProvider scopeProvider, org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext)Computes real types forBslDocumentationComment.ReturnSectionBslDocumentationComment.SectiongetCallOptionsSection()Gets the actual description of the call optionsBslDocumentationComment.SectionBslDocumentationComment.SectiongetCommentSection(int lineNumber)Gets actual documentation commentBslDocumentationComment.Sectionby line numberBslDocumentationComment.DescriptiongetDescription()Gets the main commentBslDocumentationComment.DescriptionIDescriptionPartgetDescriptionPart(int lineNumber, int offset)Gets actual documentation commentIDescriptionPartby line number and local line offsetBslDocumentationComment.SectiongetExampleSection()Gets the actual description of the exampleBslDocumentationComment.Sectionint[]getLineGlobalOffsets()Gets the offsets of the each line in comment relatively to the total method text, cannot benullintgetLineNumber()Gets the line nubmer corresponding to part.MethodgetMethod()Gets the methodMethodof the documentation commentModulegetModule()Gets the moduleModuleof the documentation commentintgetOffset()Gets offset of the begining part.BslDocumentationComment.ParametersSectiongetParametersSection()Gets the actual description of theBslDocumentationComment.ParametersSectionIDescriptionPartgetParent()Gets the parent object.BslDocumentationComment.ReturnSectiongetReturnSection()Gets the actual description of theBslDocumentationComment.ReturnSectionbooleanisDeprecated()Checks that special keyword for marking method as deprecated foundbooleanmatch(int lineNumber, int offset)Checks that this description part corresponding to the concrete line number and offsetvoidparse(List<String> templateLines, List<String> paramNames)Parses comment lines corresponding to the new documentation formatvoidparseOldFormat(List<String> templateLines, List<String> paramNames)Parses comment lines corresponding to the old documentation formatvoidsetCallOptionsSection(BslDocumentationComment.Section callOptionsSection)Sets new call optionsBslDocumentationComment.SectionvoidsetDeprecated(boolean deprecated)Sets that documentation comment corresponding to the deprecated methodvoidsetDescription(BslDocumentationComment.Description description)Sets the main commentBslDocumentationComment.DescriptionvoidsetExampleSection(BslDocumentationComment.Section exampleSection)Sets new exampleBslDocumentationComment.SectionvoidsetParametersSection(BslDocumentationComment.ParametersSection parametersSection)voidsetReturnSection(BslDocumentationComment.ReturnSection returnSection)
 
- 
- 
- 
Constructor Detail- 
BslDocumentationCommentpublic BslDocumentationComment() Empty constructor
 - 
BslDocumentationCommentpublic BslDocumentationComment(Module module, Method method, int[] lineLocalOffsets) Constructor
 - 
BslDocumentationCommentpublic BslDocumentationComment(BslContextDefMethod method) Constructor byBslContextDefMethod- 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
 
 
- 
 - 
Method Detail- 
getModulepublic Module getModule() Gets the moduleModuleof the documentation comment- Returns:
- the module Moduleof the documentation comment, can benullif model created not from method documentation comment nodes.
 
 - 
getMethodpublic Method getMethod() Gets the methodMethodof the documentation comment- Returns:
- the method Methodcan benullif model created not from method documentation comment nodes.
 
 - 
getLineGlobalOffsetspublic int[] getLineGlobalOffsets() Gets the offsets of the each line in comment relatively to the total method text, cannot benull- Returns:
- the offsets of the each line in comment, cannot return null.
 
 - 
getParentpublic IDescriptionPart getParent() Description copied from interface:IDescriptionPartGets the parent object.- Specified by:
- getParentin interface- IDescriptionPart
- Returns:
- the parent object, can return nullif it is root objectBslDocumentationCommentor object created separetly form parsing source code.
 
 - 
getOffsetpublic int getOffset() Description copied from interface:IDescriptionPartGets offset of the begining part. Offset - local inline offset- Specified by:
- getOffsetin interface- IDescriptionPart
- Returns:
- offset of the begining part.
 
 - 
getLineNumberpublic int getLineNumber() Description copied from interface:IDescriptionPartGets the line nubmer corresponding to part. Numeration starts from 0 Line number - line number corresponding to the begining of the documentation comment. Each comment starts with line with number 0- Specified by:
- getLineNumberin interface- IDescriptionPart
- Returns:
- the line nubmer corresponding to part
 
 - 
matchpublic boolean match(int lineNumber, int offset)Description copied from interface:IDescriptionPartChecks that this description part corresponding to the concrete line number and offset- Specified by:
- matchin interface- IDescriptionPart
- Parameters:
- lineNumber- number of the documentation comment line
- offset- local offset on the comment line
- Returns:
- trueif this description part corresponding to the send line number and offset,- falseotherwise
 
 - 
getDescriptionpublic BslDocumentationComment.Description getDescription() Gets the main commentBslDocumentationComment.Description- Returns:
- the main comment BslDocumentationComment.Description, nevernull
 
 - 
setDescriptionpublic void setDescription(BslDocumentationComment.Description description) Sets the main commentBslDocumentationComment.Description- Parameters:
- description- new comment- BslDocumentationComment.Description, cannot be- null
 
 - 
setParametersSectionpublic void setParametersSection(BslDocumentationComment.ParametersSection parametersSection) - Parameters:
- parametersSection- new- BslDocumentationComment.ParametersSection, can be- nullif there is no this section
 
 - 
getParametersSectionpublic BslDocumentationComment.ParametersSection getParametersSection() Gets the actual description of theBslDocumentationComment.ParametersSection- Returns:
- actual description of the BslDocumentationComment.ParametersSection, can benullif there is no it
 
 - 
setReturnSectionpublic void setReturnSection(BslDocumentationComment.ReturnSection returnSection) - Parameters:
- returnSection-- BslDocumentationComment.ReturnSection, can be- nullof there is no this section
 
 - 
getReturnSectionpublic BslDocumentationComment.ReturnSection getReturnSection() Gets the actual description of theBslDocumentationComment.ReturnSection- Returns:
- actual description of the BslDocumentationComment.ReturnSection, can benullif there is no it
 
 - 
getExampleSectionpublic BslDocumentationComment.Section getExampleSection() Gets the actual description of the exampleBslDocumentationComment.Section- Returns:
- actual description of the example BslDocumentationComment.Section, can benullif there is no it
 
 - 
setExampleSectionpublic void setExampleSection(BslDocumentationComment.Section exampleSection) Sets new exampleBslDocumentationComment.Section- Parameters:
- exampleSection- example- BslDocumentationComment.Section, can be- nullof there is no this section
 
 - 
getCallOptionsSectionpublic BslDocumentationComment.Section getCallOptionsSection() Gets the actual description of the call optionsBslDocumentationComment.Section- Returns:
- actual description of the call options BslDocumentationComment.Section, can benullif there is no it
 
 - 
setCallOptionsSectionpublic void setCallOptionsSection(BslDocumentationComment.Section callOptionsSection) Sets new call optionsBslDocumentationComment.Section- Parameters:
- exampleSection- call options- BslDocumentationComment.Section, can be- nullof there is no this section
 
 - 
isDeprecatedpublic boolean isDeprecated() Checks that special keyword for marking method as deprecated found- Returns:
- trueif the main description part start with keywords- IBslCommentToken.DEPRECATEDor- IBslCommentToken.DEPRECATED_RU,- falseotherwise
 
 - 
setDeprecatedpublic void setDeprecated(boolean deprecated) Sets that documentation comment corresponding to the deprecated method- Parameters:
- deprecated-- trueif documentation comment corresponding to the deprecated method,- falseotherwise
 
 - 
parsepublic void parse(List<String> templateLines, List<String> paramNames) Parses comment lines corresponding to the new documentation format- Parameters:
- templateLines- initial string line of the comment content, cannot be- null
- paramNames- names of the- FormalParam, cannot be- null
 
 - 
parseOldFormatpublic void parseOldFormat(List<String> templateLines, List<String> paramNames) Parses comment lines corresponding to the old documentation format- Parameters:
- templateLines- initial string line of the comment content, cannot be- null
- paramNames- names of the- FormalParam, cannot be- null
 
 - 
computeReturnTypespublic Collection<TypeItem> computeReturnTypes(org.eclipse.xtext.scoping.IScope typeScope, org.eclipse.xtext.scoping.IScopeProvider scopeProvider, org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext) Computes real types forBslDocumentationComment.ReturnSection- Parameters:
- typeScope- actual types- IScope, cannot be- null
- scopeProvider- actual- IScopeProvider, cannot be- null
- qualifiedNameConverter- actual- IQualifiedNameConverter, cannot be- null
- commentProvider- actual- BslMultiLineCommentDocumentationProvider, cannot be- null
- oldFormat-- trueif comment in old format,- falsein new format
- context-- EObjectfor resolving elements, cannot be- null
- typeComputationContext- Type system computation context. May not be- null
- Returns:
- collection of TypeItems described inBslDocumentationComment.ReturnSection, nevernull
 
 - 
computeParameterTypespublic Collection<TypeItem> computeParameterTypes(String name, org.eclipse.xtext.scoping.IScope typeScope, org.eclipse.xtext.scoping.IScopeProvider scopeProvider, org.eclipse.xtext.naming.IQualifiedNameConverter qualifiedNameConverter, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, org.eclipse.emf.ecore.EObject context, BmOperationContext typeComputationContext) Computes real types for parameter fromParameterSection- Parameters:
- name- name of the parameter from- ParameterSection, cannot be- null
- typeScope- actual types- IScope, cannot be- null
- scopeProvider- actual- IScopeProvider, cannot be- null
- qualifiedNameConverter- actual- IQualifiedNameConverter, cannot be- null
- commentProvider- actual- BslMultiLineCommentDocumentationProvider, cannot be- null
- oldFormat-- trueif comment in old format,- falsein new format
- context-- EObjectfor resolving elements, cannot be- null
- typeComputationContext- Type system computation context. May not be- null
- Returns:
- collection of TypeItems described inParameterSectionfor parameter with concrete name, nevernull
 
 - 
getCommentSectionpublic BslDocumentationComment.Section getCommentSection(int lineNumber) Gets actual documentation commentBslDocumentationComment.Sectionby line number- Parameters:
- lineNumber- number of the comment line for getting- BslDocumentationComment.Section
- Returns:
- BslDocumentationComment.Sectioncorresponding to the line number, can be- nullif there is no section on this line
 
 - 
getDescriptionPartpublic IDescriptionPart getDescriptionPart(int lineNumber, int offset) Gets actual documentation commentIDescriptionPartby line number and local line offset- Parameters:
- lineNumber- number of the comment line for getting- IDescriptionPart
- offset- local line offset for getting- IDescriptionPart
- Returns:
- IDescriptionPartcorresponding to the line number and local line offset, can be- nullif there is no description part on this line number and offset
 
 
- 
 
-