Class BaseOperation
- All Implemented Interfaces:
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.element.CodeElementWithModifiers, io.github.mmm.code.api.element.CodeElementWithName, io.github.mmm.code.api.element.CodeElementWithTypeVariables, 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.CodeItemWithModifiers, io.github.mmm.code.api.item.CodeItemWithName, io.github.mmm.code.api.item.CodeItemWithType, io.github.mmm.code.api.item.CodeItemWithVariables, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.item.CodeMutableItemWithComment, io.github.mmm.code.api.member.CodeMember, io.github.mmm.code.api.member.CodeOperation, io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.object.CodeMutable
- Direct Known Subclasses:
BaseConstructor, BaseMethod
public abstract class BaseOperation
extends BaseMember
implements io.github.mmm.code.api.member.CodeOperation
Base implementation of
CodeOperation.- 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
ConstructorsModifierConstructorDescriptionBaseOperation(BaseOperation template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor.BaseOperation(BaseOperations<?> parent, String name) The constructor.protectedBaseOperation(BaseOperations<?> parent, String name, BaseTypeVariables typeVariables) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanabstract BaseOperationcopy()protected voiddoMerge(io.github.mmm.code.api.member.CodeOperation other, io.github.mmm.code.api.merge.CodeMergeStrategy strategy) protected voidCalled on the first call ofBaseMutableItem.setImmutable().io.github.mmm.code.api.block.CodeBlockBodygetBody()abstract BaseOperations<?> abstract Executableabstract io.github.mmm.code.api.member.CodeOperationio.github.mmm.code.api.expression.CodeVariablegetVariable(String name) voidsetBody(io.github.mmm.code.api.block.CodeBlockBody body) Methods inherited from class BaseMember
getDeclaringType, getName, setNameMethods inherited from class BaseElementWithModifiers
getModifiers, setModifiersMethods inherited from class BaseElement
doInitialize, doMerge, doWrite, doWriteAnnotations, doWriteComment, doWriteDoc, getAnnotations, getComment, getDoc, removeFromParent, setCommentMethods inherited from class BaseNodeItem
getContainerItem, getContainerItemDeclared, getContext, getLanguage, getSource, toPathStringMethods inherited from class BaseMutableItem
doCopyNode, doCopyNodeUnsafe, doMapList, doneInitialize, getDefaultCopyMapper, getDefaultEncoding, 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.CodeElementWithModifiers
setModifiersMethods inherited from interface io.github.mmm.code.api.element.CodeElementWithName
setNameMethods 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.item.CodeItemWithModifiers
getModifiersMethods inherited from interface io.github.mmm.code.api.item.CodeItemWithName
getNameMethods inherited from interface io.github.mmm.code.api.item.CodeItemWithType
getTypeMethods inherited from interface io.github.mmm.code.api.object.CodeMutable
isImmutable, isMutableMethods inherited from interface io.github.mmm.code.api.item.CodeMutableItem
setImmutableMethods inherited from interface io.github.mmm.code.api.item.CodeMutableItemWithComment
setCommentMethods inherited from interface io.github.mmm.code.api.node.CodeNodeItem
copyMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSource
-
Constructor Details
-
BaseOperation
The constructor. -
BaseOperation
The constructor.- Parameters:
parent- theparent.name- thename.typeVariables- thetype variables.
-
BaseOperation
The copy-constructor.- Parameters:
template- theBaseOperationto copy.mapper- theCodeCopyMapper.
-
-
Method Details
-
getParent
- Specified by:
getParentin interfaceio.github.mmm.code.api.member.CodeMember- Specified by:
getParentin interfaceio.github.mmm.code.api.node.CodeNode- Specified by:
getParentin interfaceio.github.mmm.code.api.member.CodeOperation- Specified by:
getParentin classBaseMember
-
getVariable
- Specified by:
getVariablein interfaceio.github.mmm.code.api.item.CodeItemWithVariables
-
doSetImmutable
protected void doSetImmutable()Description copied from class:BaseMutableItemCalled on the first call ofBaseMutableItem.setImmutable(). Has to be overridden to updateCollections, make child items immutable, etc.- Overrides:
doSetImmutablein classBaseElement
-
getTypeParameters
- Specified by:
getTypeParametersin interfaceio.github.mmm.code.api.element.CodeElementWithTypeVariables
-
getParameters
- Specified by:
getParametersin interfaceio.github.mmm.code.api.member.CodeOperation
-
getExceptions
- Specified by:
getExceptionsin interfaceio.github.mmm.code.api.member.CodeOperation
-
getBody
public io.github.mmm.code.api.block.CodeBlockBody getBody()- Specified by:
getBodyin interfaceio.github.mmm.code.api.node.CodeFunction
-
setBody
public void setBody(io.github.mmm.code.api.block.CodeBlockBody body) - Specified by:
setBodyin interfaceio.github.mmm.code.api.node.CodeFunction
-
getReflectiveObject
- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.element.CodeElementWithTypeVariables- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.member.CodeMember- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.item.CodeMutableItem- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.member.CodeOperation- Specified by:
getReflectiveObjectin classBaseMember
-
getSourceCodeObject
public abstract io.github.mmm.code.api.member.CodeOperation getSourceCodeObject()- Specified by:
getSourceCodeObjectin classBaseMember- Returns:
- the optional internal
CodeItemrepresenting the source-code (to merge). Otherwisenull. This is an internal API. Do not use or rely on it from outside.
-
doMerge
protected void doMerge(io.github.mmm.code.api.member.CodeOperation other, io.github.mmm.code.api.merge.CodeMergeStrategy strategy) - Parameters:
other- theCodeOperationto merge.strategy- theCodeMergeStrategy.- See Also:
-
copy
- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElement- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElementWithDeclaringType- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElementWithModifiers- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElementWithName- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElementWithTypeVariables- Specified by:
copyin interfaceio.github.mmm.code.api.member.CodeMember- 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.member.CodeOperation- Specified by:
copyin classBaseMember
-
canHaveBody
public boolean canHaveBody()- Specified by:
canHaveBodyin interfaceio.github.mmm.code.api.node.CodeFunction
-