Class BaseParameter
- All Implemented Interfaces:
io.github.mmm.code.api.arg.CodeOperationArg, io.github.mmm.code.api.arg.CodeParameter, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.arg.CodeParameters, io.github.mmm.code.api.arg.CodeParameter>, io.github.mmm.code.api.element.CodeElement, io.github.mmm.code.api.element.CodeElementWithDeclaringType, io.github.mmm.code.api.element.CodeElementWithName, io.github.mmm.code.api.expression.CodeExpression, io.github.mmm.code.api.expression.CodeVariable, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithComment, io.github.mmm.code.api.item.CodeItemWithDeclaration, io.github.mmm.code.api.item.CodeItemWithDeclaringType, io.github.mmm.code.api.item.CodeItemWithName, 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.merge.CodeMergeableItem<io.github.mmm.code.api.arg.CodeParameter>, io.github.mmm.code.api.merge.CodeSimpleMergeableItem<io.github.mmm.code.api.arg.CodeParameter>, 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
public class BaseParameter
extends BaseOperationArg
implements io.github.mmm.code.api.arg.CodeParameter
Base implementation of
CodeParameter.- 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
ConstructorsConstructorDescriptionBaseParameter(BaseParameter template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor.BaseParameter(BaseParameters parent, Parameter reflectiveObject) The constructor.BaseParameter(BaseParameters parent, String name) The constructor. -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper) 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) io.github.mmm.code.api.expression.CodeLiteralevaluate()getName()protected Typeio.github.mmm.code.api.arg.CodeParameterbooleanio.github.mmm.code.api.arg.CodeParametermerge(io.github.mmm.code.api.arg.CodeParameter other, io.github.mmm.code.api.merge.CodeMergeStrategy strategy) voidvoidsetVarArgs(boolean varArgs) voidwriteReference(Appendable sink, boolean declaration, Boolean qualified) Methods inherited from class BaseOperationArg
doInitialize, doMerge, getDefaultType, getType, setTypeMethods inherited from class BaseElement
doMerge, doSetImmutable, 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.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.CodeItemWithDeclaration
writeReferenceMethods 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.item.CodeMutableItemWithType
setTypeMethods inherited from interface io.github.mmm.code.api.merge.CodeSimpleMergeableItem
mergeMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSource
-
Constructor Details
-
BaseParameter
The constructor. -
BaseParameter
The constructor.- Parameters:
parent- theparent.reflectiveObject- thereflective object. May benull.
-
BaseParameter
The copy-constructor.- Parameters:
template- theBaseParameterto copy.mapper- theCodeCopyMapper.
-
-
Method Details
-
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.arg.CodeParameters, io.github.mmm.code.api.arg.CodeParameter>
-
getDeclaringOperation
- Specified by:
getDeclaringOperationin interfaceio.github.mmm.code.api.node.CodeNodeItemWithDeclaringOperation- Specified by:
getDeclaringOperationin classBaseOperationArg
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceio.github.mmm.code.api.item.CodeItemWithDeclaringType
-
getName
- Specified by:
getNamein interfaceio.github.mmm.code.api.item.CodeItemWithName
-
setName
- Specified by:
setNamein interfaceio.github.mmm.code.api.element.CodeElementWithName
-
isVarArgs
public boolean isVarArgs()- Specified by:
isVarArgsin interfaceio.github.mmm.code.api.arg.CodeParameter
-
setVarArgs
public void setVarArgs(boolean varArgs) - Specified by:
setVarArgsin interfaceio.github.mmm.code.api.arg.CodeParameter
-
getReflectiveObject
- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.item.CodeMutableItem- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.arg.CodeParameter- Overrides:
getReflectiveObjectin classBaseMutableItem
-
getReflectiveObjectType
- Specified by:
getReflectiveObjectTypein classBaseOperationArg- Returns:
- the argument
Typeof thereflective object. - See Also:
-
getSourceCodeObject
public io.github.mmm.code.api.arg.CodeParameter getSourceCodeObject()- Overrides:
getSourceCodeObjectin classBaseElement- 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.
-
evaluate
public io.github.mmm.code.api.expression.CodeLiteral evaluate()- Specified by:
evaluatein interfaceio.github.mmm.code.api.expression.CodeExpression
-
merge
public io.github.mmm.code.api.arg.CodeParameter merge(io.github.mmm.code.api.arg.CodeParameter other, io.github.mmm.code.api.merge.CodeMergeStrategy strategy) - Specified by:
mergein interfaceio.github.mmm.code.api.merge.CodeSimpleMergeableItem<io.github.mmm.code.api.arg.CodeParameter>
-
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.CodeElementWithName- 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.arg.CodeParameters, io.github.mmm.code.api.arg.CodeParameter>- Specified by:
copyin interfaceio.github.mmm.code.api.arg.CodeParameter
-
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.arg.CodeParameters, io.github.mmm.code.api.arg.CodeParameter>
-
doWrite
protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException - Overrides:
doWritein classBaseOperationArg- 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:
-
writeReference
public void writeReference(Appendable sink, boolean declaration, Boolean qualified) throws IOException - Specified by:
writeReferencein interfaceio.github.mmm.code.api.item.CodeItemWithDeclaration- Specified by:
writeReferencein interfaceio.github.mmm.code.api.expression.CodeVariable- Throws:
IOException
-
doWriteDeclaration
protected void doWriteDeclaration(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException - Overrides:
doWriteDeclarationin classBaseOperationArg- 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.
-