Class BaseBlockBody
java.lang.Object
io.github.mmm.code.base.item.BaseItem
io.github.mmm.code.base.item.BaseMutableItem
io.github.mmm.code.base.node.BaseNodeItem
io.github.mmm.code.base.block.BaseBlock
io.github.mmm.code.base.block.BaseBlockBody
- All Implemented Interfaces:
io.github.mmm.code.api.block.CodeBlock, io.github.mmm.code.api.block.CodeBlockBody, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.block.CodeBlockBody>, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithVariables, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.object.CodeMutable
Base implementation of
CodeBlockBody.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
Fields inherited from interface io.github.mmm.code.api.item.CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionBaseBlockBody(io.github.mmm.code.api.node.CodeFunction parent) The constructor.BaseBlockBody(io.github.mmm.code.api.node.CodeFunction parent, io.github.mmm.code.api.statement.CodeStatement... statements) The constructor.BaseBlockBody(io.github.mmm.code.api.node.CodeFunction parent, List<io.github.mmm.code.api.statement.CodeStatement> statements) The constructor.BaseBlockBody(BaseBlockBody template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor. -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper) io.github.mmm.code.api.node.CodeFunctionprotected io.github.mmm.code.api.expression.CodeVariablegetVariableFromParent(String name) voidsetParent(io.github.mmm.code.api.node.CodeFunction parent) Methods inherited from class BaseBlock
add, addText, doSetImmutable, doWrite, getStatements, getVariable, getVariable, writePrefix, writeSuffixMethods inherited from class BaseNodeItem
doInitialize, getContainerItem, getContainerItemDeclared, getContext, getLanguage, getSource, toPathStringMethods inherited from class BaseMutableItem
doCopyNode, doCopyNodeUnsafe, doMapList, doneInitialize, getDefaultCopyMapper, getDefaultEncoding, getReflectiveObject, getSourceCodeObject, initialize, initialize, isImmutable, isInitialized, isInitializing, isSystemImmutable, isSystemImmutable, makeImmutable, makeImmutable, setImmutable, setImmutableIfNotSystemImmutable, verifyMutalbe, writeItemMethods 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.block.CodeBlock
add, addText, getStatements, getVariable, getVariable, isEmptyMethods inherited from interface io.github.mmm.code.api.item.CodeItem
getLanguage, getSourceCode, write, write, write, write, write, writeMethods inherited from interface io.github.mmm.code.api.object.CodeMutable
isImmutable, isMutableMethods inherited from interface io.github.mmm.code.api.item.CodeMutableItem
getReflectiveObject, setImmutableMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSource
-
Constructor Details
-
BaseBlockBody
public BaseBlockBody(io.github.mmm.code.api.node.CodeFunction parent) The constructor.- Parameters:
parent- theparent.
-
BaseBlockBody
public BaseBlockBody(io.github.mmm.code.api.node.CodeFunction parent, io.github.mmm.code.api.statement.CodeStatement... statements) The constructor.- Parameters:
parent- theparent.statements- thestatements.
-
BaseBlockBody
public BaseBlockBody(io.github.mmm.code.api.node.CodeFunction parent, List<io.github.mmm.code.api.statement.CodeStatement> statements) The constructor.- Parameters:
parent- theparent.statements- thestatements.
-
BaseBlockBody
The copy-constructor.- Parameters:
template- theBaseBlockto copy.mapper- theCodeCopyMapper.
-
-
Method Details
-
getParent
public io.github.mmm.code.api.node.CodeFunction getParent()- Specified by:
getParentin interfaceio.github.mmm.code.api.node.CodeNode- Specified by:
getParentin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.block.CodeBlockBody>
-
setParent
public void setParent(io.github.mmm.code.api.node.CodeFunction parent) - Parameters:
parent- the new value ofgetParent().
-
getVariableFromParent
- Specified by:
getVariableFromParentin classBaseBlock- Parameters:
name- thenameof the requestedCodeVariable.- Returns:
- the
CodeVariabledeclared by theparent nodewith the givennameornullif not found.
-
copy
- Specified by:
copyin interfaceio.github.mmm.code.api.block.CodeBlock- Specified by:
copyin interfaceio.github.mmm.code.api.block.CodeBlockBody- Specified by:
copyin interfaceio.github.mmm.code.api.item.CodeMutableItem- Specified by:
copyin interfaceio.github.mmm.code.api.node.CodeNodeItem- Specified by:
copyin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.block.CodeBlockBody>
-
copy
- Specified by:
copyin interfaceio.github.mmm.code.api.item.CodeMutableItem- Specified by:
copyin interfaceio.github.mmm.code.api.node.CodeNodeItem- Specified by:
copyin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.block.CodeBlockBody>
-