Class BaseBlockComment
java.lang.Object
io.github.mmm.code.base.item.BaseItem
io.github.mmm.code.base.comment.BaseComment
io.github.mmm.code.base.comment.BaseBlockComment
- All Implemented Interfaces:
io.github.mmm.code.api.comment.CodeBlockComment, io.github.mmm.code.api.comment.CodeComment, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithVariables, io.github.mmm.code.api.statement.CodeStatement, Iterable<String>
public class BaseBlockComment
extends BaseComment
implements io.github.mmm.code.api.comment.CodeBlockComment
Base implementation of
CodeBlockComment.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
FieldsFields inherited from interface io.github.mmm.code.api.item.CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionBaseBlockComment(io.github.mmm.code.api.comment.CodeComment comment) The constructor.BaseBlockComment(String... commentLines) The constructor.BaseBlockComment(List<String> commentLines) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) Methods inherited from class BaseItem
getOwningType, getSourceCode, getSpaces, toString, writeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.code.api.comment.CodeComment
getVariable, iteratorMethods inherited from interface io.github.mmm.code.api.item.CodeItem
getLanguage, getSourceCode, write, write, write, write, write, writeMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
EMPTY_COMMENT
An empty comment instance.
-
-
Constructor Details
-
BaseBlockComment
public BaseBlockComment(io.github.mmm.code.api.comment.CodeComment comment) The constructor.- Parameters:
comment- an existing instance ofCodeCommentto copy/convert to a block comment.
-
BaseBlockComment
The constructor.- Parameters:
commentLines- thecomment lines.
-
BaseBlockComment
The constructor.- Parameters:
commentLines- thecomment lines.
-
-
Method Details
-
getCommentLines
-
doWrite
protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException - Specified by:
doWritein classBaseItem- Parameters:
sink- theAppendablewhere toappendthe code from thisCodeItem.newline- the newlineString.defaultIndent- theStringused for indentation (e.g. a number of spaces to insert per indent level).currentIndent- the current indent (number of spaces). Initially the empty string (""). Before a recursion thedefaultIndentwill be appended.language- theCodeLanguageto use.- Throws:
IOException- if thrown byAppendable.- See Also:
-