Class BslDocCommentSerializer
java.lang.Object
com._1c.g5.v8.dt.bsl.documentation.comment.BslDocCommentSerializer
Bsl Documentation comment model serializer. Allows to serialize comment to the string with new or old format, set
up some formatting style.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new bsl doc comment serializer with defaul section space = 2 and ignoring line numbers in the model. -
Method Summary
Modifier and TypeMethodDescriptionGets the line separator.int
Gets the line numbers of space between sections.boolean
Checks if need to align fields of type section to type name position.boolean
Checks if serializer ignores line numbers inmodel
objects.boolean
Checks if it needs to serialize link in brackets.boolean
Checks if string presentation must be in old format or in new formatboolean
Checks if need to use Russian keywords.static final BslDocCommentSerializer.Builder
Creates new Bslcomment
BslDocCommentSerializer
builder.serialize
(BslDocumentationComment comment) Serializes comment to the string with default line formatter (as line separator) and default indent symbols.serialize
(BslDocumentationComment comment, String lineFormatter, String indent) Serializes comment to the string.void
setAlignFields
(boolean alignFields) Sets that it need to align fieldsof type section to type name position.void
setIgnoreLineNumbers
(boolean ignoreLineNumbers) Sets serializer to ignore line numbers inmodel
objects.void
setLineSeparator
(String lineSeparator) Sets the line separator.void
setLinkInBrackets
(boolean linkInBrackets) Sets the link need to serialize in brackets.void
setOldFormat
(boolean oldFormat) Sets the string presentation must be in old format or in new format.void
setRussian
(boolean isRu) Sets serialiser need to use Russian keywords.void
setSectionSpace
(int sectionSpace) Sets the line numbers of space between sections.
-
Constructor Details
-
BslDocCommentSerializer
public BslDocCommentSerializer()Instantiates a new bsl doc comment serializer with defaul section space = 2 and ignoring line numbers in the model.
-
-
Method Details
-
newBuilder
Creates new Bslcomment
BslDocCommentSerializer
builder.- Returns:
- the documentation comment serializer builder
-
getSectionSpace
public int getSectionSpace()Gets the line numbers of space between sections. Default is 2.- Returns:
- the section space
-
setSectionSpace
public void setSectionSpace(int sectionSpace) Sets the line numbers of space between sections. Default is 2.- Parameters:
sectionSpace
- the new section space
-
isIgnoreLineNumbers
public boolean isIgnoreLineNumbers()Checks if serializer ignores line numbers inmodel
objects.- Returns:
- true, if serializer is ignoring line numbers
-
setIgnoreLineNumbers
public void setIgnoreLineNumbers(boolean ignoreLineNumbers) Sets serializer to ignore line numbers inmodel
objects.- Parameters:
ignoreLineNumbers
- the new ignore line numbers
-
isRussian
public boolean isRussian()Checks if need to use Russian keywords.- Returns:
- true, if need to use russian keywords.
-
setRussian
public void setRussian(boolean isRu) Sets serialiser need to use Russian keywords.- Parameters:
isRu
- true if need to use Russian keywords.
-
isOldFormat
public boolean isOldFormat()Checks if string presentation must be in old format or in new format- Returns:
- true, if
true
if string presentation must be in old format,false
in new format
-
setOldFormat
public void setOldFormat(boolean oldFormat) Sets the string presentation must be in old format or in new format.- Parameters:
oldFormat
-true
if string presentation must be in old format,false
in new format
-
isAlignFields
public boolean isAlignFields()Checks if need to align fields of type section to type name position.- Returns:
- true, if need to align fields
-
setAlignFields
public void setAlignFields(boolean alignFields) Sets that it need to align fieldsof type section to type name position.- Parameters:
alignFields
- true, if need to align fields, otherwise start field from begin of line
-
getLineSeparator
Gets the line separator.- Returns:
- the line separator, cannot return
null
.
-
setLineSeparator
Sets the line separator.- Parameters:
lineSeparator
- the new line separator, cannot benull
.
-
isLinkInBrackets
public boolean isLinkInBrackets()Checks if it needs to serialize link in brackets.- Returns:
- true, if it needs to serialize link in brackets.
-
setLinkInBrackets
public void setLinkInBrackets(boolean linkInBrackets) Sets the link need to serialize in brackets.- Parameters:
linkInBrackets
- true, if it needs to serialize link in brackets.
-
serialize
Serializes comment to the string with default line formatter (as line separator) and default indent symbols.- Parameters:
comment
- the documentation comment model- Returns:
- string presentation of the documentation comment, never
null
, if description is empty line withIBslCommentToken.LINE_STARTER
will be returned
-
serialize
Serializes comment to the string.- Parameters:
comment
- the documentation comment modellineFormatter
- symbols added beforeIBslCommentToken.LINE_STARTER
for each line, cannot benull
indent
- symbols for indent extra fields, cannot benull
- Returns:
- string presentation of the documentation comment, never
null
, if description is empty line withIBslCommentToken.LINE_STARTER
will be returned
-