Class TypeSection
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.Section
-
- com._1c.g5.v8.dt.bsl.documentation.comment.TypeSection
-
- All Implemented Interfaces:
IDescriptionPart
public class TypeSection extends BslDocumentationComment.Section
Class represents type section in Bsl documentation comment. Type section can contain some parts:- Main part - set of the type names - should be write in one line, devided by
IBslCommentToken.TYPE_SECTION_TYPE_DELIMETER
- Description of the extra fields - writes in new line, main part should be end with
IBslCommentToken.TYPE_SECTION_EXTENSION_COLON
- Text description of the type section - always writes after main part and extra fields part in new format, or writes after main part and before extra fields in old format
[TypeName1, TypeName2: extraFieldForType2 (
If user want that collection type contains special type for elements in collection - should usedTypeSection
for field)? (description of the field)? ]IBslCommentToken.CONTAINS
Examle of Array that contains elements with String type[Array contains String]
Complicated case, when Array contains some types String and Structure, and Structure has extra fields[Array contains String, Structure: fieldForStructure1 *fieldForStructure2 ]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeSection.FieldDefinition
Class represents extra fields inTypeSection.TypeDefinition
and parameter definition inBslDocumentationComment.ParametersSection
static class
TypeSection.LinkContainsTypeDefinition
Implementation ofTypeSection.TypeDefinition
which containsLinkPart
to the element for getting types for element collection.static class
TypeSection.TypeDefinition
Special objects represents one type fromTypeSection
.
-
Constructor Summary
Constructors Constructor Description TypeSection(IDescriptionPart parent, int lineNumber)
Constructor.TypeSection(IDescriptionPart parent, int lineNumber, int offset, int headerKeywordLength)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeSection()
Sets that section was closedvoid
fill(List<TypeItem> typeItems, String description, boolean isRu)
Fills type section with realTypeItem
void
fill(List<TypeItem> typeItems, String description, boolean isRu, org.eclipse.emf.ecore.EObject context)
Fills type section with realTypeItem
BslDocumentationComment.Description
getCurrentDescription()
Gets actualBslDocumentationComment.Description
for adding new content.IDescriptionPart
getDescriptionPart(int lineNumber, int offset)
Gets actual documentation commentIDescriptionPart
by line number and local line offsetBslDocumentationComment.Description
getSourceDescription()
GetsBslDocumentationComment.Description
which contains content of the main part of type sectionBslDocumentationComment.Description
getSourceExtensionDescription()
GetsBslDocumentationComment.Description
which contains content of the extra fields part of type sectionList<TypeSection.TypeDefinition>
getTypeDefinitions()
GetsTypeSection.TypeDefinition
described in type sectionvoid
hasTypeExtensionPart(boolean isExtensionPart)
Sets that section has extra fields partboolean
isClose()
Checks that section was closed or notboolean
isExtensionPart()
Checks that section has extra fields partboolean
match(int lineNumber, int offset)
Checks that this description part corresponding to the concrete line number and offset-
Methods inherited from class com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.Section
getDescription, getHeaderKeywordLength, getLineNumber, getOffset, getParent
-
-
-
-
Constructor Detail
-
TypeSection
public TypeSection(IDescriptionPart parent, int lineNumber, int offset, int headerKeywordLength)
Constructor.- Parameters:
parent
- the parent object, cannot benull
.lineNumber
- number of line from the comment begining corresponding to the start line of the sectionoffset
- local line offset of the begining section on the lineheaderKeywordLength
- length of the keyword of the section
-
TypeSection
public TypeSection(IDescriptionPart parent, int lineNumber)
Constructor. This constructor should be used if section description created programmatically- Parameters:
parent
- the parent object, cannot benull
.lineNumber
- number of line from the comment begining corresponding to the start line of the section
-
-
Method Detail
-
getTypeDefinitions
public List<TypeSection.TypeDefinition> getTypeDefinitions()
GetsTypeSection.TypeDefinition
described in type section- Returns:
TypeSection.TypeDefinition
described in type section, nevernull
-
getSourceDescription
public BslDocumentationComment.Description getSourceDescription()
GetsBslDocumentationComment.Description
which contains content of the main part of type section- Returns:
BslDocumentationComment.Description
which contains content of the main part of type section, nevernull
-
getSourceExtensionDescription
public BslDocumentationComment.Description getSourceExtensionDescription()
GetsBslDocumentationComment.Description
which contains content of the extra fields part of type section- Returns:
BslDocumentationComment.Description
which contains content of the the extra fields part of type section, nevernull
-
getCurrentDescription
public BslDocumentationComment.Description getCurrentDescription()
Gets actualBslDocumentationComment.Description
for adding new content. IfIBslCommentToken.TYPE_SECTION_EXTENSION_COLON
was found earlier thengetSourceExtensionDescription()
will be returned, if type section was closed earlier thenBslDocumentationComment.Section.getDescription()
will be returned else main partgetSourceDescription()
will be returned- Returns:
- actual
BslDocumentationComment.Description
for adding new content, nevernull
-
closeSection
public void closeSection()
Sets that section was closed
-
isClose
public boolean isClose()
Checks that section was closed or not- Returns:
true
if section is closed,false
otherwise
-
hasTypeExtensionPart
public void hasTypeExtensionPart(boolean isExtensionPart)
Sets that section has extra fields part- Parameters:
isExtensionPart
-true
if section has extra fields part,false
otherwise
-
isExtensionPart
public boolean isExtensionPart()
Checks that section has extra fields part- Returns:
true
if section has extra fields part,false
otherwise
-
match
public boolean match(int lineNumber, int offset)
Description copied from interface:IDescriptionPart
Checks that this description part corresponding to the concrete line number and offset- Specified by:
match
in interfaceIDescriptionPart
- Overrides:
match
in classBslDocumentationComment.Section
- Parameters:
lineNumber
- number of the documentation comment lineoffset
- local offset on the comment line- Returns:
true
if this description part corresponding to the send line number and offset,false
otherwise
-
getDescriptionPart
public IDescriptionPart getDescriptionPart(int lineNumber, int offset)
Gets actual documentation commentIDescriptionPart
by line number and local line offset- Parameters:
lineNumber
- number of the comment line for gettingIDescriptionPart
offset
- local line offset for gettingIDescriptionPart
- Returns:
IDescriptionPart
corresponding to the line number and local line offset, can benull
if there is no description part on this line number and offset
-
fill
public void fill(List<TypeItem> typeItems, String description, boolean isRu)
Fills type section with realTypeItem
- Parameters:
typeItems
- collection of the realTypeItem
s, cannot benull
description
- text description of the type section, cannot benull
isRu
-true
if should use Russian name of the type in creating type section,false
if should use English names
-
fill
public void fill(List<TypeItem> typeItems, String description, boolean isRu, org.eclipse.emf.ecore.EObject context)
Fills type section with realTypeItem
- Parameters:
typeItems
- collection of the realTypeItem
s, cannot benull
description
- text description of the type section, cannot benull
isRu
-true
if should use Russian name of the type in creating type section,false
if should use English namescontext
- contextEObject
for resolvingTypeItem
from collection, can benull
if resolving not needed
-
-