Class BaseOperationArg
- All Implemented Interfaces:
io.github.mmm.code.api.arg.CodeOperationArg, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.element.CodeElement, io.github.mmm.code.api.element.CodeElementWithDeclaringType, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithComment, io.github.mmm.code.api.item.CodeItemWithDeclaringType, io.github.mmm.code.api.item.CodeItemWithType, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.item.CodeMutableItemWithComment, io.github.mmm.code.api.item.CodeMutableItemWithType, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.node.CodeNodeItemWithDeclaringOperation, io.github.mmm.code.api.object.CodeMutable
- Direct Known Subclasses:
BaseException, BaseParameter, BaseReturn
public abstract class BaseOperationArg
extends BaseElementWithDeclaringType
implements io.github.mmm.code.api.arg.CodeOperationArg
Base implementation of
CodeOperationArg.- Since:
- 1.0.0
- Author:
- hohwille
-
Field Summary
Fields inherited from interface io.github.mmm.code.api.item.CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor.BaseOperationArg(BaseOperationArg template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled fromBaseMutableItem.initialize()on first invocation.protected voiddoMerge(io.github.mmm.code.api.arg.CodeOperationArg other, io.github.mmm.code.api.merge.CodeMergeStrategy strategy) protected voiddoWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) protected voiddoWriteDeclaration(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) abstract BaseOperationprotected BaseTypeprotected abstract TypegetType()voidsetType(io.github.mmm.code.api.type.CodeGenericType type) Methods inherited from class BaseElement
doMerge, doSetImmutable, doWriteAnnotations, doWriteComment, doWriteDoc, getAnnotations, getComment, getDoc, getSourceCodeObject, removeFromParent, setCommentMethods inherited from class BaseNodeItem
getContainerItem, getContainerItemDeclared, getContext, getLanguage, getSource, toPathStringMethods inherited from class BaseMutableItem
doCopyNode, doCopyNodeUnsafe, doMapList, doneInitialize, getDefaultCopyMapper, getDefaultEncoding, getReflectiveObject, 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.element.CodeElement
getAnnotations, getDoc, removeFromParentMethods inherited from interface io.github.mmm.code.api.element.CodeElementWithDeclaringType
copyMethods 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.item.CodeItemWithComment
getCommentMethods inherited from interface io.github.mmm.code.api.item.CodeItemWithDeclaringType
getDeclaringTypeMethods 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.item.CodeMutableItemWithComment
setCommentMethods inherited from interface io.github.mmm.code.api.node.CodeNode
getParentMethods inherited from interface io.github.mmm.code.api.node.CodeNodeItem
copyMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSource
-
Constructor Details
-
BaseOperationArg
public BaseOperationArg()The constructor. -
BaseOperationArg
public BaseOperationArg(BaseOperationArg template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor.- Parameters:
template- theBaseOperationArgto copy.mapper- theCodeCopyMapper.
-
-
Method Details
-
doInitialize
protected void doInitialize()Description copied from class:BaseNodeItemCalled fromBaseMutableItem.initialize()on first invocation. May be overridden but never be called from anywhere else.- Overrides:
doInitializein classBaseElement
-
getDeclaringOperation
- Specified by:
getDeclaringOperationin interfaceio.github.mmm.code.api.node.CodeNodeItemWithDeclaringOperation
-
getType
- Specified by:
getTypein interfaceio.github.mmm.code.api.item.CodeItemWithType
-
getDefaultType
-
setType
public void setType(io.github.mmm.code.api.type.CodeGenericType type) - Specified by:
setTypein interfaceio.github.mmm.code.api.item.CodeMutableItemWithType
-
getReflectiveObjectType
- Returns:
- the argument
Typeof thereflective object. - See Also:
-
doMerge
protected void doMerge(io.github.mmm.code.api.arg.CodeOperationArg other, io.github.mmm.code.api.merge.CodeMergeStrategy strategy) - Parameters:
other- theCodeOperationArgto merge.strategy- theCodeMergeStrategy.- See Also:
-
doWrite
protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException - Overrides:
doWritein classBaseElement- 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:
-
doWriteDeclaration
protected void doWriteDeclaration(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException - 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.
-