Class BslDocCommentSerializer
- java.lang.Object
- 
- com._1c.g5.v8.dt.bsl.documentation.comment.BslDocCommentSerializer
 
- 
 public class BslDocCommentSerializer extends Object Bsl Documentation comment model serializer. Allows to serialize comment to the string with new or old format, set up some formatting style.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classBslDocCommentSerializer.BuilderThe configuration builder ofserializer
 - 
Constructor SummaryConstructors Constructor Description BslDocCommentSerializer()Instantiates a new bsl doc comment serializer with defaul section space = 2 and ignoring line numbers in the model.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLineSeparator()Gets the line separator.intgetSectionSpace()Gets the line numbers of space between sections.booleanisAlignFields()Checks if need to align fields of type section to type name position.booleanisIgnoreLineNumbers()Checks if serializer ignores line numbers inmodelobjects.booleanisLinkInBrackets()Checks if it needs to serialize link in brackets.booleanisOldFormat()Checks if string presentation must be in old format or in new formatbooleanisRussian()Checks if need to use Russian keywords.static BslDocCommentSerializer.BuildernewBuilder()Creates new BslcommentBslDocCommentSerializerbuilder.Stringserialize(BslDocumentationComment comment)Serializes comment to the string with default line formatter (as line separator) and default indent symbols.Stringserialize(BslDocumentationComment comment, String lineFormatter, String indent)Serializes comment to the string.voidsetAlignFields(boolean alignFields)Sets that it need to align fieldsof type section to type name position.voidsetIgnoreLineNumbers(boolean ignoreLineNumbers)Sets serializer to ignore line numbers inmodelobjects.voidsetLineSeparator(String lineSeparator)Sets the line separator.voidsetLinkInBrackets(boolean linkInBrackets)Sets the link need to serialize in brackets.voidsetOldFormat(boolean oldFormat)Sets the string presentation must be in old format or in new format.voidsetRussian(boolean isRu)Sets serialiser need to use Russian keywords.voidsetSectionSpace(int sectionSpace)Sets the line numbers of space between sections.
 
- 
- 
- 
Method Detail- 
newBuilderpublic static final BslDocCommentSerializer.Builder newBuilder() Creates new BslcommentBslDocCommentSerializerbuilder.- Returns:
- the documentation comment serializer builder
 
 - 
getSectionSpacepublic int getSectionSpace() Gets the line numbers of space between sections. Default is 2.- Returns:
- the section space
 
 - 
setSectionSpacepublic void setSectionSpace(int sectionSpace) Sets the line numbers of space between sections. Default is 2.- Parameters:
- sectionSpace- the new section space
 
 - 
isIgnoreLineNumberspublic boolean isIgnoreLineNumbers() Checks if serializer ignores line numbers inmodelobjects.- Returns:
- true, if serializer is ignoring line numbers
 
 - 
setIgnoreLineNumberspublic void setIgnoreLineNumbers(boolean ignoreLineNumbers) Sets serializer to ignore line numbers inmodelobjects.- Parameters:
- ignoreLineNumbers- the new ignore line numbers
 
 - 
isRussianpublic boolean isRussian() Checks if need to use Russian keywords.- Returns:
- true, if need to use russian keywords.
 
 - 
setRussianpublic void setRussian(boolean isRu) Sets serialiser need to use Russian keywords.- Parameters:
- isRu- true if need to use Russian keywords.
 
 - 
isOldFormatpublic boolean isOldFormat() Checks if string presentation must be in old format or in new format- Returns:
- true, if trueif string presentation must be in old format,falsein new format
 
 - 
setOldFormatpublic void setOldFormat(boolean oldFormat) Sets the string presentation must be in old format or in new format.- Parameters:
- oldFormat-- trueif string presentation must be in old format,- falsein new format
 
 - 
isAlignFieldspublic boolean isAlignFields() Checks if need to align fields of type section to type name position.- Returns:
- true, if need to align fields
 
 - 
setAlignFieldspublic 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
 
 - 
getLineSeparatorpublic String getLineSeparator() Gets the line separator.- Returns:
- the line separator, cannot return null.
 
 - 
setLineSeparatorpublic void setLineSeparator(String lineSeparator) Sets the line separator.- Parameters:
- lineSeparator- the new line separator, cannot be- null.
 
 - 
isLinkInBracketspublic boolean isLinkInBrackets() Checks if it needs to serialize link in brackets.- Returns:
- true, if it needs to serialize link in brackets.
 
 - 
setLinkInBracketspublic void setLinkInBrackets(boolean linkInBrackets) Sets the link need to serialize in brackets.- Parameters:
- linkInBrackets- true, if it needs to serialize link in brackets.
 
 - 
serializepublic String serialize(BslDocumentationComment comment) 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_STARTERwill be returned
 
 - 
serializepublic String serialize(BslDocumentationComment comment, String lineFormatter, String indent) Serializes comment to the string.- Parameters:
- comment- the documentation comment model
- lineFormatter- symbols added before- IBslCommentToken.LINE_STARTERfor each line, cannot be- null
- indent- symbols for indent extra fields, cannot be- null
- Returns:
- string presentation of the documentation comment, never null, if description is empty line withIBslCommentToken.LINE_STARTERwill be returned
 
 
- 
 
-